
obj/user/fairness.debug:     file format elf32-i386


Disassembly of section .text:

00800020 <_start>:
// starts us running when we are initially loaded into a new environment.
.text
.globl _start
_start:
	// See if we were started with arguments on the stack
	cmpl $USTACKTOP, %esp
  800020:	81 fc 00 e0 bf ee    	cmp    $0xeebfe000,%esp
	jne args_exist
  800026:	75 04                	jne    80002c <args_exist>

	// If not, push dummy argc/argv arguments.
	// This happens when we are loaded by the kernel,
	// because the kernel does not know about passing arguments.
	pushl $0
  800028:	6a 00                	push   $0x0
	pushl $0
  80002a:	6a 00                	push   $0x0

0080002c <args_exist>:

args_exist:
	call libmain
  80002c:	e8 74 00 00 00       	call   8000a5 <libmain>
1:	jmp 1b
  800031:	eb fe                	jmp    800031 <args_exist+0x5>

00800033 <umain>:

#include <inc/lib.h>

void
umain(int argc, char **argv)
{
  800033:	f3 0f 1e fb          	endbr32 
  800037:	55                   	push   %ebp
  800038:	89 e5                	mov    %esp,%ebp
  80003a:	56                   	push   %esi
  80003b:	53                   	push   %ebx
  80003c:	83 ec 10             	sub    $0x10,%esp
	envid_t who, id;

	id = sys_getenvid();
  80003f:	e8 45 0b 00 00       	call   800b89 <sys_getenvid>
  800044:	89 c3                	mov    %eax,%ebx

	if (thisenv == &envs[1]) {
  800046:	81 3d 04 40 80 00 7c 	cmpl   $0xeec0007c,0x804004
  80004d:	00 c0 ee 
  800050:	74 2d                	je     80007f <umain+0x4c>
		while (1) {
			ipc_recv(&who, 0, 0);
			cprintf("%x recv from %x\n", id, who);
		}
	} else {
		cprintf("%x loop sending to %x\n", id, envs[1].env_id);
  800052:	a1 c4 00 c0 ee       	mov    0xeec000c4,%eax
  800057:	83 ec 04             	sub    $0x4,%esp
  80005a:	50                   	push   %eax
  80005b:	53                   	push   %ebx
  80005c:	68 51 1f 80 00       	push   $0x801f51
  800061:	e8 4e 01 00 00       	call   8001b4 <cprintf>
  800066:	83 c4 10             	add    $0x10,%esp
		while (1)
			ipc_send(envs[1].env_id, 0, 0, 0);
  800069:	a1 c4 00 c0 ee       	mov    0xeec000c4,%eax
  80006e:	6a 00                	push   $0x0
  800070:	6a 00                	push   $0x0
  800072:	6a 00                	push   $0x0
  800074:	50                   	push   %eax
  800075:	e8 e7 0d 00 00       	call   800e61 <ipc_send>
  80007a:	83 c4 10             	add    $0x10,%esp
  80007d:	eb ea                	jmp    800069 <umain+0x36>
			ipc_recv(&who, 0, 0);
  80007f:	8d 75 f4             	lea    -0xc(%ebp),%esi
  800082:	83 ec 04             	sub    $0x4,%esp
  800085:	6a 00                	push   $0x0
  800087:	6a 00                	push   $0x0
  800089:	56                   	push   %esi
  80008a:	e8 51 0d 00 00       	call   800de0 <ipc_recv>
			cprintf("%x recv from %x\n", id, who);
  80008f:	83 c4 0c             	add    $0xc,%esp
  800092:	ff 75 f4             	pushl  -0xc(%ebp)
  800095:	53                   	push   %ebx
  800096:	68 40 1f 80 00       	push   $0x801f40
  80009b:	e8 14 01 00 00       	call   8001b4 <cprintf>
  8000a0:	83 c4 10             	add    $0x10,%esp
  8000a3:	eb dd                	jmp    800082 <umain+0x4f>

008000a5 <libmain>:
const volatile struct Env *thisenv;
const char *binaryname = "<unknown>";

void
libmain(int argc, char **argv)
{
  8000a5:	f3 0f 1e fb          	endbr32 
  8000a9:	55                   	push   %ebp
  8000aa:	89 e5                	mov    %esp,%ebp
  8000ac:	56                   	push   %esi
  8000ad:	53                   	push   %ebx
  8000ae:	8b 5d 08             	mov    0x8(%ebp),%ebx
  8000b1:	8b 75 0c             	mov    0xc(%ebp),%esi
	;    //系统调用，我们已经在Exercise 7中实现了
	
	
	
	//屏幕上打印出来了字母，但后续报错了，有意思，让我看看问题出现在哪。
	thisenv=0;
  8000b4:	c7 05 04 40 80 00 00 	movl   $0x0,0x804004
  8000bb:	00 00 00 
	thisenv = &envs[ENVX(sys_getenvid())];      //获取Env结构指针
  8000be:	e8 c6 0a 00 00       	call   800b89 <sys_getenvid>
  8000c3:	25 ff 03 00 00       	and    $0x3ff,%eax
  8000c8:	6b c0 7c             	imul   $0x7c,%eax,%eax
  8000cb:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  8000d0:	a3 04 40 80 00       	mov    %eax,0x804004

	// save the name of the program so that panic() can use it
	if (argc > 0)
  8000d5:	85 db                	test   %ebx,%ebx
  8000d7:	7e 07                	jle    8000e0 <libmain+0x3b>
		binaryname = argv[0];
  8000d9:	8b 06                	mov    (%esi),%eax
  8000db:	a3 00 30 80 00       	mov    %eax,0x803000

	// call user main routine
	umain(argc, argv);
  8000e0:	83 ec 08             	sub    $0x8,%esp
  8000e3:	56                   	push   %esi
  8000e4:	53                   	push   %ebx
  8000e5:	e8 49 ff ff ff       	call   800033 <umain>

	// exit gracefully
	exit();
  8000ea:	e8 0a 00 00 00       	call   8000f9 <exit>
}
  8000ef:	83 c4 10             	add    $0x10,%esp
  8000f2:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8000f5:	5b                   	pop    %ebx
  8000f6:	5e                   	pop    %esi
  8000f7:	5d                   	pop    %ebp
  8000f8:	c3                   	ret    

008000f9 <exit>:

#include <inc/lib.h>

void
exit(void)
{
  8000f9:	f3 0f 1e fb          	endbr32 
  8000fd:	55                   	push   %ebp
  8000fe:	89 e5                	mov    %esp,%ebp
  800100:	83 ec 08             	sub    $0x8,%esp
	close_all();
  800103:	e8 dd 0f 00 00       	call   8010e5 <close_all>
	sys_env_destroy(0);
  800108:	83 ec 0c             	sub    $0xc,%esp
  80010b:	6a 00                	push   $0x0
  80010d:	e8 32 0a 00 00       	call   800b44 <sys_env_destroy>
}
  800112:	83 c4 10             	add    $0x10,%esp
  800115:	c9                   	leave  
  800116:	c3                   	ret    

00800117 <putch>:
};


static void
putch(int ch, struct printbuf *b)
{
  800117:	f3 0f 1e fb          	endbr32 
  80011b:	55                   	push   %ebp
  80011c:	89 e5                	mov    %esp,%ebp
  80011e:	53                   	push   %ebx
  80011f:	83 ec 04             	sub    $0x4,%esp
  800122:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	b->buf[b->idx++] = ch;
  800125:	8b 13                	mov    (%ebx),%edx
  800127:	8d 42 01             	lea    0x1(%edx),%eax
  80012a:	89 03                	mov    %eax,(%ebx)
  80012c:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80012f:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
	if (b->idx == 256-1) {
  800133:	3d ff 00 00 00       	cmp    $0xff,%eax
  800138:	74 09                	je     800143 <putch+0x2c>
		sys_cputs(b->buf, b->idx);
		b->idx = 0;
	}
	b->cnt++;
  80013a:	83 43 04 01          	addl   $0x1,0x4(%ebx)
}
  80013e:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  800141:	c9                   	leave  
  800142:	c3                   	ret    
		sys_cputs(b->buf, b->idx);
  800143:	83 ec 08             	sub    $0x8,%esp
  800146:	68 ff 00 00 00       	push   $0xff
  80014b:	8d 43 08             	lea    0x8(%ebx),%eax
  80014e:	50                   	push   %eax
  80014f:	e8 ab 09 00 00       	call   800aff <sys_cputs>
		b->idx = 0;
  800154:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  80015a:	83 c4 10             	add    $0x10,%esp
  80015d:	eb db                	jmp    80013a <putch+0x23>

0080015f <vcprintf>:

int
vcprintf(const char *fmt, va_list ap)
{
  80015f:	f3 0f 1e fb          	endbr32 
  800163:	55                   	push   %ebp
  800164:	89 e5                	mov    %esp,%ebp
  800166:	81 ec 18 01 00 00    	sub    $0x118,%esp
	struct printbuf b;

	b.idx = 0;
  80016c:	c7 85 f0 fe ff ff 00 	movl   $0x0,-0x110(%ebp)
  800173:	00 00 00 
	b.cnt = 0;
  800176:	c7 85 f4 fe ff ff 00 	movl   $0x0,-0x10c(%ebp)
  80017d:	00 00 00 
	vprintfmt((void*)putch, &b, fmt, ap);
  800180:	ff 75 0c             	pushl  0xc(%ebp)
  800183:	ff 75 08             	pushl  0x8(%ebp)
  800186:	8d 85 f0 fe ff ff    	lea    -0x110(%ebp),%eax
  80018c:	50                   	push   %eax
  80018d:	68 17 01 80 00       	push   $0x800117
  800192:	e8 20 01 00 00       	call   8002b7 <vprintfmt>
	sys_cputs(b.buf, b.idx);
  800197:	83 c4 08             	add    $0x8,%esp
  80019a:	ff b5 f0 fe ff ff    	pushl  -0x110(%ebp)
  8001a0:	8d 85 f8 fe ff ff    	lea    -0x108(%ebp),%eax
  8001a6:	50                   	push   %eax
  8001a7:	e8 53 09 00 00       	call   800aff <sys_cputs>

	return b.cnt;
}
  8001ac:	8b 85 f4 fe ff ff    	mov    -0x10c(%ebp),%eax
  8001b2:	c9                   	leave  
  8001b3:	c3                   	ret    

008001b4 <cprintf>:

int
cprintf(const char *fmt, ...)
{
  8001b4:	f3 0f 1e fb          	endbr32 
  8001b8:	55                   	push   %ebp
  8001b9:	89 e5                	mov    %esp,%ebp
  8001bb:	83 ec 10             	sub    $0x10,%esp
	va_list ap;
	int cnt;

	va_start(ap, fmt);
  8001be:	8d 45 0c             	lea    0xc(%ebp),%eax
	cnt = vcprintf(fmt, ap);
  8001c1:	50                   	push   %eax
  8001c2:	ff 75 08             	pushl  0x8(%ebp)
  8001c5:	e8 95 ff ff ff       	call   80015f <vcprintf>
	va_end(ap);

	return cnt;
}
  8001ca:	c9                   	leave  
  8001cb:	c3                   	ret    

008001cc <printnum>:
 * using specified putch function and associated pointer putdat.
 */
static void
printnum(void (*putch)(int, void*), void *putdat,
	 unsigned long long num, unsigned base, int width, int padc)
{
  8001cc:	55                   	push   %ebp
  8001cd:	89 e5                	mov    %esp,%ebp
  8001cf:	57                   	push   %edi
  8001d0:	56                   	push   %esi
  8001d1:	53                   	push   %ebx
  8001d2:	83 ec 1c             	sub    $0x1c,%esp
  8001d5:	89 c7                	mov    %eax,%edi
  8001d7:	89 d6                	mov    %edx,%esi
  8001d9:	8b 45 08             	mov    0x8(%ebp),%eax
  8001dc:	8b 55 0c             	mov    0xc(%ebp),%edx
  8001df:	89 d1                	mov    %edx,%ecx
  8001e1:	89 c2                	mov    %eax,%edx
  8001e3:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8001e6:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  8001e9:	8b 45 10             	mov    0x10(%ebp),%eax
  8001ec:	8b 5d 14             	mov    0x14(%ebp),%ebx
	// first recursively print all preceding (more significant) digits
	if (num >= base) {
  8001ef:	89 45 e0             	mov    %eax,-0x20(%ebp)
  8001f2:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
  8001f9:	39 c2                	cmp    %eax,%edx
  8001fb:	1b 4d e4             	sbb    -0x1c(%ebp),%ecx
  8001fe:	72 3e                	jb     80023e <printnum+0x72>
		printnum(putch, putdat, num / base, base, width - 1, padc);
  800200:	83 ec 0c             	sub    $0xc,%esp
  800203:	ff 75 18             	pushl  0x18(%ebp)
  800206:	83 eb 01             	sub    $0x1,%ebx
  800209:	53                   	push   %ebx
  80020a:	50                   	push   %eax
  80020b:	83 ec 08             	sub    $0x8,%esp
  80020e:	ff 75 e4             	pushl  -0x1c(%ebp)
  800211:	ff 75 e0             	pushl  -0x20(%ebp)
  800214:	ff 75 dc             	pushl  -0x24(%ebp)
  800217:	ff 75 d8             	pushl  -0x28(%ebp)
  80021a:	e8 b1 1a 00 00       	call   801cd0 <__udivdi3>
  80021f:	83 c4 18             	add    $0x18,%esp
  800222:	52                   	push   %edx
  800223:	50                   	push   %eax
  800224:	89 f2                	mov    %esi,%edx
  800226:	89 f8                	mov    %edi,%eax
  800228:	e8 9f ff ff ff       	call   8001cc <printnum>
  80022d:	83 c4 20             	add    $0x20,%esp
  800230:	eb 13                	jmp    800245 <printnum+0x79>
	} else {
		// print any needed pad characters before first digit
		while (--width > 0)
			putch(padc, putdat);
  800232:	83 ec 08             	sub    $0x8,%esp
  800235:	56                   	push   %esi
  800236:	ff 75 18             	pushl  0x18(%ebp)
  800239:	ff d7                	call   *%edi
  80023b:	83 c4 10             	add    $0x10,%esp
		while (--width > 0)
  80023e:	83 eb 01             	sub    $0x1,%ebx
  800241:	85 db                	test   %ebx,%ebx
  800243:	7f ed                	jg     800232 <printnum+0x66>
	}

	// then print this (the least significant) digit
	putch("0123456789abcdef"[num % base], putdat);
  800245:	83 ec 08             	sub    $0x8,%esp
  800248:	56                   	push   %esi
  800249:	83 ec 04             	sub    $0x4,%esp
  80024c:	ff 75 e4             	pushl  -0x1c(%ebp)
  80024f:	ff 75 e0             	pushl  -0x20(%ebp)
  800252:	ff 75 dc             	pushl  -0x24(%ebp)
  800255:	ff 75 d8             	pushl  -0x28(%ebp)
  800258:	e8 83 1b 00 00       	call   801de0 <__umoddi3>
  80025d:	83 c4 14             	add    $0x14,%esp
  800260:	0f be 80 72 1f 80 00 	movsbl 0x801f72(%eax),%eax
  800267:	50                   	push   %eax
  800268:	ff d7                	call   *%edi
}
  80026a:	83 c4 10             	add    $0x10,%esp
  80026d:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800270:	5b                   	pop    %ebx
  800271:	5e                   	pop    %esi
  800272:	5f                   	pop    %edi
  800273:	5d                   	pop    %ebp
  800274:	c3                   	ret    

00800275 <sprintputch>:
	int cnt;
};

static void
sprintputch(int ch, struct sprintbuf *b)
{
  800275:	f3 0f 1e fb          	endbr32 
  800279:	55                   	push   %ebp
  80027a:	89 e5                	mov    %esp,%ebp
  80027c:	8b 45 0c             	mov    0xc(%ebp),%eax
	b->cnt++;
  80027f:	83 40 08 01          	addl   $0x1,0x8(%eax)
	if (b->buf < b->ebuf)
  800283:	8b 10                	mov    (%eax),%edx
  800285:	3b 50 04             	cmp    0x4(%eax),%edx
  800288:	73 0a                	jae    800294 <sprintputch+0x1f>
		*b->buf++ = ch;
  80028a:	8d 4a 01             	lea    0x1(%edx),%ecx
  80028d:	89 08                	mov    %ecx,(%eax)
  80028f:	8b 45 08             	mov    0x8(%ebp),%eax
  800292:	88 02                	mov    %al,(%edx)
}
  800294:	5d                   	pop    %ebp
  800295:	c3                   	ret    

00800296 <printfmt>:
{
  800296:	f3 0f 1e fb          	endbr32 
  80029a:	55                   	push   %ebp
  80029b:	89 e5                	mov    %esp,%ebp
  80029d:	83 ec 08             	sub    $0x8,%esp
	va_start(ap, fmt);
  8002a0:	8d 45 14             	lea    0x14(%ebp),%eax
	vprintfmt(putch, putdat, fmt, ap);
  8002a3:	50                   	push   %eax
  8002a4:	ff 75 10             	pushl  0x10(%ebp)
  8002a7:	ff 75 0c             	pushl  0xc(%ebp)
  8002aa:	ff 75 08             	pushl  0x8(%ebp)
  8002ad:	e8 05 00 00 00       	call   8002b7 <vprintfmt>
}
  8002b2:	83 c4 10             	add    $0x10,%esp
  8002b5:	c9                   	leave  
  8002b6:	c3                   	ret    

008002b7 <vprintfmt>:
{
  8002b7:	f3 0f 1e fb          	endbr32 
  8002bb:	55                   	push   %ebp
  8002bc:	89 e5                	mov    %esp,%ebp
  8002be:	57                   	push   %edi
  8002bf:	56                   	push   %esi
  8002c0:	53                   	push   %ebx
  8002c1:	83 ec 3c             	sub    $0x3c,%esp
  8002c4:	8b 75 08             	mov    0x8(%ebp),%esi
  8002c7:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  8002ca:	8b 7d 10             	mov    0x10(%ebp),%edi
  8002cd:	e9 5d 03 00 00       	jmp    80062f <vprintfmt+0x378>
		padc = ' ';
  8002d2:	c6 45 d3 20          	movb   $0x20,-0x2d(%ebp)
		altflag = 0;
  8002d6:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
		precision = -1;
  8002dd:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
		width = -1;
  8002e4:	c7 45 d4 ff ff ff ff 	movl   $0xffffffff,-0x2c(%ebp)
		lflag = 0;
  8002eb:	b9 00 00 00 00       	mov    $0x0,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  8002f0:	8d 47 01             	lea    0x1(%edi),%eax
  8002f3:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  8002f6:	0f b6 17             	movzbl (%edi),%edx
  8002f9:	8d 42 dd             	lea    -0x23(%edx),%eax
  8002fc:	3c 55                	cmp    $0x55,%al
  8002fe:	0f 87 ae 03 00 00    	ja     8006b2 <vprintfmt+0x3fb>
  800304:	0f b6 c0             	movzbl %al,%eax
  800307:	3e ff 24 85 c0 20 80 	notrack jmp *0x8020c0(,%eax,4)
  80030e:	00 
  80030f:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			padc = '-';
  800312:	c6 45 d3 2d          	movb   $0x2d,-0x2d(%ebp)
  800316:	eb d8                	jmp    8002f0 <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  800318:	8b 7d e4             	mov    -0x1c(%ebp),%edi
  80031b:	c6 45 d3 30          	movb   $0x30,-0x2d(%ebp)
  80031f:	eb cf                	jmp    8002f0 <vprintfmt+0x39>
  800321:	0f b6 d2             	movzbl %dl,%edx
  800324:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			for (precision = 0; ; ++fmt) {
  800327:	b8 00 00 00 00       	mov    $0x0,%eax
  80032c:	89 4d e4             	mov    %ecx,-0x1c(%ebp)
				precision = precision * 10 + ch - '0';
  80032f:	8d 04 80             	lea    (%eax,%eax,4),%eax
  800332:	8d 44 42 d0          	lea    -0x30(%edx,%eax,2),%eax
				ch = *fmt;
  800336:	0f be 17             	movsbl (%edi),%edx
				if (ch < '0' || ch > '9')
  800339:	8d 4a d0             	lea    -0x30(%edx),%ecx
  80033c:	83 f9 09             	cmp    $0x9,%ecx
  80033f:	77 55                	ja     800396 <vprintfmt+0xdf>
			for (precision = 0; ; ++fmt) {
  800341:	83 c7 01             	add    $0x1,%edi
				precision = precision * 10 + ch - '0';
  800344:	eb e9                	jmp    80032f <vprintfmt+0x78>
			precision = va_arg(ap, int);
  800346:	8b 45 14             	mov    0x14(%ebp),%eax
  800349:	8b 00                	mov    (%eax),%eax
  80034b:	89 45 d8             	mov    %eax,-0x28(%ebp)
  80034e:	8b 45 14             	mov    0x14(%ebp),%eax
  800351:	8d 40 04             	lea    0x4(%eax),%eax
  800354:	89 45 14             	mov    %eax,0x14(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  800357:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			if (width < 0)
  80035a:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  80035e:	79 90                	jns    8002f0 <vprintfmt+0x39>
				width = precision, precision = -1;
  800360:	8b 45 d8             	mov    -0x28(%ebp),%eax
  800363:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  800366:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
  80036d:	eb 81                	jmp    8002f0 <vprintfmt+0x39>
  80036f:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  800372:	85 c0                	test   %eax,%eax
  800374:	ba 00 00 00 00       	mov    $0x0,%edx
  800379:	0f 49 d0             	cmovns %eax,%edx
  80037c:	89 55 d4             	mov    %edx,-0x2c(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  80037f:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  800382:	e9 69 ff ff ff       	jmp    8002f0 <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  800387:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			altflag = 1;
  80038a:	c7 45 e0 01 00 00 00 	movl   $0x1,-0x20(%ebp)
			goto reswitch;
  800391:	e9 5a ff ff ff       	jmp    8002f0 <vprintfmt+0x39>
  800396:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  800399:	89 45 d8             	mov    %eax,-0x28(%ebp)
  80039c:	eb bc                	jmp    80035a <vprintfmt+0xa3>
			lflag++;
  80039e:	83 c1 01             	add    $0x1,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  8003a1:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  8003a4:	e9 47 ff ff ff       	jmp    8002f0 <vprintfmt+0x39>
			putch(va_arg(ap, int), putdat);
  8003a9:	8b 45 14             	mov    0x14(%ebp),%eax
  8003ac:	8d 78 04             	lea    0x4(%eax),%edi
  8003af:	83 ec 08             	sub    $0x8,%esp
  8003b2:	53                   	push   %ebx
  8003b3:	ff 30                	pushl  (%eax)
  8003b5:	ff d6                	call   *%esi
			break;
  8003b7:	83 c4 10             	add    $0x10,%esp
			putch(va_arg(ap, int), putdat);
  8003ba:	89 7d 14             	mov    %edi,0x14(%ebp)
			break;
  8003bd:	e9 6a 02 00 00       	jmp    80062c <vprintfmt+0x375>
			err = va_arg(ap, int);
  8003c2:	8b 45 14             	mov    0x14(%ebp),%eax
  8003c5:	8d 78 04             	lea    0x4(%eax),%edi
  8003c8:	8b 00                	mov    (%eax),%eax
  8003ca:	99                   	cltd   
  8003cb:	31 d0                	xor    %edx,%eax
  8003cd:	29 d0                	sub    %edx,%eax
			if (err >= MAXERROR || (p = error_string[err]) == NULL)
  8003cf:	83 f8 0f             	cmp    $0xf,%eax
  8003d2:	7f 23                	jg     8003f7 <vprintfmt+0x140>
  8003d4:	8b 14 85 20 22 80 00 	mov    0x802220(,%eax,4),%edx
  8003db:	85 d2                	test   %edx,%edx
  8003dd:	74 18                	je     8003f7 <vprintfmt+0x140>
				printfmt(putch, putdat, "%s", p);
  8003df:	52                   	push   %edx
  8003e0:	68 6d 23 80 00       	push   $0x80236d
  8003e5:	53                   	push   %ebx
  8003e6:	56                   	push   %esi
  8003e7:	e8 aa fe ff ff       	call   800296 <printfmt>
  8003ec:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  8003ef:	89 7d 14             	mov    %edi,0x14(%ebp)
  8003f2:	e9 35 02 00 00       	jmp    80062c <vprintfmt+0x375>
				printfmt(putch, putdat, "error %d", err);
  8003f7:	50                   	push   %eax
  8003f8:	68 8a 1f 80 00       	push   $0x801f8a
  8003fd:	53                   	push   %ebx
  8003fe:	56                   	push   %esi
  8003ff:	e8 92 fe ff ff       	call   800296 <printfmt>
  800404:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  800407:	89 7d 14             	mov    %edi,0x14(%ebp)
				printfmt(putch, putdat, "error %d", err);
  80040a:	e9 1d 02 00 00       	jmp    80062c <vprintfmt+0x375>
			if ((p = va_arg(ap, char *)) == NULL)
  80040f:	8b 45 14             	mov    0x14(%ebp),%eax
  800412:	83 c0 04             	add    $0x4,%eax
  800415:	89 45 c8             	mov    %eax,-0x38(%ebp)
  800418:	8b 45 14             	mov    0x14(%ebp),%eax
  80041b:	8b 10                	mov    (%eax),%edx
				p = "(null)";
  80041d:	85 d2                	test   %edx,%edx
  80041f:	b8 83 1f 80 00       	mov    $0x801f83,%eax
  800424:	0f 45 c2             	cmovne %edx,%eax
  800427:	89 45 cc             	mov    %eax,-0x34(%ebp)
			if (width > 0 && padc != '-')
  80042a:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  80042e:	7e 06                	jle    800436 <vprintfmt+0x17f>
  800430:	80 7d d3 2d          	cmpb   $0x2d,-0x2d(%ebp)
  800434:	75 0d                	jne    800443 <vprintfmt+0x18c>
				for (width -= strnlen(p, precision); width > 0; width--)
  800436:	8b 45 cc             	mov    -0x34(%ebp),%eax
  800439:	89 c7                	mov    %eax,%edi
  80043b:	03 45 d4             	add    -0x2c(%ebp),%eax
  80043e:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  800441:	eb 55                	jmp    800498 <vprintfmt+0x1e1>
  800443:	83 ec 08             	sub    $0x8,%esp
  800446:	ff 75 d8             	pushl  -0x28(%ebp)
  800449:	ff 75 cc             	pushl  -0x34(%ebp)
  80044c:	e8 15 03 00 00       	call   800766 <strnlen>
  800451:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  800454:	29 c2                	sub    %eax,%edx
  800456:	89 55 c4             	mov    %edx,-0x3c(%ebp)
  800459:	83 c4 10             	add    $0x10,%esp
  80045c:	89 d7                	mov    %edx,%edi
					putch(padc, putdat);
  80045e:	0f be 45 d3          	movsbl -0x2d(%ebp),%eax
  800462:	89 45 d4             	mov    %eax,-0x2c(%ebp)
				for (width -= strnlen(p, precision); width > 0; width--)
  800465:	85 ff                	test   %edi,%edi
  800467:	7e 11                	jle    80047a <vprintfmt+0x1c3>
					putch(padc, putdat);
  800469:	83 ec 08             	sub    $0x8,%esp
  80046c:	53                   	push   %ebx
  80046d:	ff 75 d4             	pushl  -0x2c(%ebp)
  800470:	ff d6                	call   *%esi
				for (width -= strnlen(p, precision); width > 0; width--)
  800472:	83 ef 01             	sub    $0x1,%edi
  800475:	83 c4 10             	add    $0x10,%esp
  800478:	eb eb                	jmp    800465 <vprintfmt+0x1ae>
  80047a:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  80047d:	85 d2                	test   %edx,%edx
  80047f:	b8 00 00 00 00       	mov    $0x0,%eax
  800484:	0f 49 c2             	cmovns %edx,%eax
  800487:	29 c2                	sub    %eax,%edx
  800489:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  80048c:	eb a8                	jmp    800436 <vprintfmt+0x17f>
					putch(ch, putdat);
  80048e:	83 ec 08             	sub    $0x8,%esp
  800491:	53                   	push   %ebx
  800492:	52                   	push   %edx
  800493:	ff d6                	call   *%esi
  800495:	83 c4 10             	add    $0x10,%esp
  800498:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
  80049b:	29 f9                	sub    %edi,%ecx
			for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
  80049d:	83 c7 01             	add    $0x1,%edi
  8004a0:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  8004a4:	0f be d0             	movsbl %al,%edx
  8004a7:	85 d2                	test   %edx,%edx
  8004a9:	74 4b                	je     8004f6 <vprintfmt+0x23f>
  8004ab:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
  8004af:	78 06                	js     8004b7 <vprintfmt+0x200>
  8004b1:	83 6d d8 01          	subl   $0x1,-0x28(%ebp)
  8004b5:	78 1e                	js     8004d5 <vprintfmt+0x21e>
				if (altflag && (ch < ' ' || ch > '~'))
  8004b7:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  8004bb:	74 d1                	je     80048e <vprintfmt+0x1d7>
  8004bd:	0f be c0             	movsbl %al,%eax
  8004c0:	83 e8 20             	sub    $0x20,%eax
  8004c3:	83 f8 5e             	cmp    $0x5e,%eax
  8004c6:	76 c6                	jbe    80048e <vprintfmt+0x1d7>
					putch('?', putdat);
  8004c8:	83 ec 08             	sub    $0x8,%esp
  8004cb:	53                   	push   %ebx
  8004cc:	6a 3f                	push   $0x3f
  8004ce:	ff d6                	call   *%esi
  8004d0:	83 c4 10             	add    $0x10,%esp
  8004d3:	eb c3                	jmp    800498 <vprintfmt+0x1e1>
  8004d5:	89 cf                	mov    %ecx,%edi
  8004d7:	eb 0e                	jmp    8004e7 <vprintfmt+0x230>
				putch(' ', putdat);
  8004d9:	83 ec 08             	sub    $0x8,%esp
  8004dc:	53                   	push   %ebx
  8004dd:	6a 20                	push   $0x20
  8004df:	ff d6                	call   *%esi
			for (; width > 0; width--)
  8004e1:	83 ef 01             	sub    $0x1,%edi
  8004e4:	83 c4 10             	add    $0x10,%esp
  8004e7:	85 ff                	test   %edi,%edi
  8004e9:	7f ee                	jg     8004d9 <vprintfmt+0x222>
			if ((p = va_arg(ap, char *)) == NULL)
  8004eb:	8b 45 c8             	mov    -0x38(%ebp),%eax
  8004ee:	89 45 14             	mov    %eax,0x14(%ebp)
  8004f1:	e9 36 01 00 00       	jmp    80062c <vprintfmt+0x375>
  8004f6:	89 cf                	mov    %ecx,%edi
  8004f8:	eb ed                	jmp    8004e7 <vprintfmt+0x230>
	if (lflag >= 2)
  8004fa:	83 f9 01             	cmp    $0x1,%ecx
  8004fd:	7f 1f                	jg     80051e <vprintfmt+0x267>
	else if (lflag)
  8004ff:	85 c9                	test   %ecx,%ecx
  800501:	74 67                	je     80056a <vprintfmt+0x2b3>
		return va_arg(*ap, long);
  800503:	8b 45 14             	mov    0x14(%ebp),%eax
  800506:	8b 00                	mov    (%eax),%eax
  800508:	89 45 d8             	mov    %eax,-0x28(%ebp)
  80050b:	89 c1                	mov    %eax,%ecx
  80050d:	c1 f9 1f             	sar    $0x1f,%ecx
  800510:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  800513:	8b 45 14             	mov    0x14(%ebp),%eax
  800516:	8d 40 04             	lea    0x4(%eax),%eax
  800519:	89 45 14             	mov    %eax,0x14(%ebp)
  80051c:	eb 17                	jmp    800535 <vprintfmt+0x27e>
		return va_arg(*ap, long long);
  80051e:	8b 45 14             	mov    0x14(%ebp),%eax
  800521:	8b 50 04             	mov    0x4(%eax),%edx
  800524:	8b 00                	mov    (%eax),%eax
  800526:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800529:	89 55 dc             	mov    %edx,-0x24(%ebp)
  80052c:	8b 45 14             	mov    0x14(%ebp),%eax
  80052f:	8d 40 08             	lea    0x8(%eax),%eax
  800532:	89 45 14             	mov    %eax,0x14(%ebp)
			if ((long long) num < 0) {
  800535:	8b 55 d8             	mov    -0x28(%ebp),%edx
  800538:	8b 4d dc             	mov    -0x24(%ebp),%ecx
			base = 10;
  80053b:	b8 0a 00 00 00       	mov    $0xa,%eax
			if ((long long) num < 0) {
  800540:	85 c9                	test   %ecx,%ecx
  800542:	0f 89 ca 00 00 00    	jns    800612 <vprintfmt+0x35b>
				putch('-', putdat);
  800548:	83 ec 08             	sub    $0x8,%esp
  80054b:	53                   	push   %ebx
  80054c:	6a 2d                	push   $0x2d
  80054e:	ff d6                	call   *%esi
				num = -(long long) num;
  800550:	8b 55 d8             	mov    -0x28(%ebp),%edx
  800553:	8b 4d dc             	mov    -0x24(%ebp),%ecx
  800556:	f7 da                	neg    %edx
  800558:	83 d1 00             	adc    $0x0,%ecx
  80055b:	f7 d9                	neg    %ecx
  80055d:	83 c4 10             	add    $0x10,%esp
			base = 10;
  800560:	b8 0a 00 00 00       	mov    $0xa,%eax
  800565:	e9 a8 00 00 00       	jmp    800612 <vprintfmt+0x35b>
		return va_arg(*ap, int);
  80056a:	8b 45 14             	mov    0x14(%ebp),%eax
  80056d:	8b 00                	mov    (%eax),%eax
  80056f:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800572:	99                   	cltd   
  800573:	89 55 dc             	mov    %edx,-0x24(%ebp)
  800576:	8b 45 14             	mov    0x14(%ebp),%eax
  800579:	8d 40 04             	lea    0x4(%eax),%eax
  80057c:	89 45 14             	mov    %eax,0x14(%ebp)
  80057f:	eb b4                	jmp    800535 <vprintfmt+0x27e>
	if (lflag >= 2)
  800581:	83 f9 01             	cmp    $0x1,%ecx
  800584:	7f 1b                	jg     8005a1 <vprintfmt+0x2ea>
	else if (lflag)
  800586:	85 c9                	test   %ecx,%ecx
  800588:	74 2c                	je     8005b6 <vprintfmt+0x2ff>
		return va_arg(*ap, unsigned long);
  80058a:	8b 45 14             	mov    0x14(%ebp),%eax
  80058d:	8b 10                	mov    (%eax),%edx
  80058f:	b9 00 00 00 00       	mov    $0x0,%ecx
  800594:	8d 40 04             	lea    0x4(%eax),%eax
  800597:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  80059a:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long);
  80059f:	eb 71                	jmp    800612 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  8005a1:	8b 45 14             	mov    0x14(%ebp),%eax
  8005a4:	8b 10                	mov    (%eax),%edx
  8005a6:	8b 48 04             	mov    0x4(%eax),%ecx
  8005a9:	8d 40 08             	lea    0x8(%eax),%eax
  8005ac:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  8005af:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long long);
  8005b4:	eb 5c                	jmp    800612 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  8005b6:	8b 45 14             	mov    0x14(%ebp),%eax
  8005b9:	8b 10                	mov    (%eax),%edx
  8005bb:	b9 00 00 00 00       	mov    $0x0,%ecx
  8005c0:	8d 40 04             	lea    0x4(%eax),%eax
  8005c3:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  8005c6:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned int);
  8005cb:	eb 45                	jmp    800612 <vprintfmt+0x35b>
			putch('X', putdat);
  8005cd:	83 ec 08             	sub    $0x8,%esp
  8005d0:	53                   	push   %ebx
  8005d1:	6a 58                	push   $0x58
  8005d3:	ff d6                	call   *%esi
			putch('X', putdat);
  8005d5:	83 c4 08             	add    $0x8,%esp
  8005d8:	53                   	push   %ebx
  8005d9:	6a 58                	push   $0x58
  8005db:	ff d6                	call   *%esi
			putch('X', putdat);
  8005dd:	83 c4 08             	add    $0x8,%esp
  8005e0:	53                   	push   %ebx
  8005e1:	6a 58                	push   $0x58
  8005e3:	ff d6                	call   *%esi
			break;
  8005e5:	83 c4 10             	add    $0x10,%esp
  8005e8:	eb 42                	jmp    80062c <vprintfmt+0x375>
			putch('0', putdat);
  8005ea:	83 ec 08             	sub    $0x8,%esp
  8005ed:	53                   	push   %ebx
  8005ee:	6a 30                	push   $0x30
  8005f0:	ff d6                	call   *%esi
			putch('x', putdat);
  8005f2:	83 c4 08             	add    $0x8,%esp
  8005f5:	53                   	push   %ebx
  8005f6:	6a 78                	push   $0x78
  8005f8:	ff d6                	call   *%esi
			num = (unsigned long long)
  8005fa:	8b 45 14             	mov    0x14(%ebp),%eax
  8005fd:	8b 10                	mov    (%eax),%edx
  8005ff:	b9 00 00 00 00       	mov    $0x0,%ecx
			goto number;
  800604:	83 c4 10             	add    $0x10,%esp
				(uintptr_t) va_arg(ap, void *);
  800607:	8d 40 04             	lea    0x4(%eax),%eax
  80060a:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  80060d:	b8 10 00 00 00       	mov    $0x10,%eax
			printnum(putch, putdat, num, base, width, padc);
  800612:	83 ec 0c             	sub    $0xc,%esp
  800615:	0f be 7d d3          	movsbl -0x2d(%ebp),%edi
  800619:	57                   	push   %edi
  80061a:	ff 75 d4             	pushl  -0x2c(%ebp)
  80061d:	50                   	push   %eax
  80061e:	51                   	push   %ecx
  80061f:	52                   	push   %edx
  800620:	89 da                	mov    %ebx,%edx
  800622:	89 f0                	mov    %esi,%eax
  800624:	e8 a3 fb ff ff       	call   8001cc <printnum>
			break;
  800629:	83 c4 20             	add    $0x20,%esp
			if ((p = va_arg(ap, char *)) == NULL)
  80062c:	8b 7d e4             	mov    -0x1c(%ebp),%edi
		while ((ch = *(unsigned char *) fmt++) != '%') {
  80062f:	83 c7 01             	add    $0x1,%edi
  800632:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  800636:	83 f8 25             	cmp    $0x25,%eax
  800639:	0f 84 93 fc ff ff    	je     8002d2 <vprintfmt+0x1b>
			if (ch == '\0')
  80063f:	85 c0                	test   %eax,%eax
  800641:	0f 84 8b 00 00 00    	je     8006d2 <vprintfmt+0x41b>
			putch(ch, putdat);
  800647:	83 ec 08             	sub    $0x8,%esp
  80064a:	53                   	push   %ebx
  80064b:	50                   	push   %eax
  80064c:	ff d6                	call   *%esi
  80064e:	83 c4 10             	add    $0x10,%esp
  800651:	eb dc                	jmp    80062f <vprintfmt+0x378>
	if (lflag >= 2)
  800653:	83 f9 01             	cmp    $0x1,%ecx
  800656:	7f 1b                	jg     800673 <vprintfmt+0x3bc>
	else if (lflag)
  800658:	85 c9                	test   %ecx,%ecx
  80065a:	74 2c                	je     800688 <vprintfmt+0x3d1>
		return va_arg(*ap, unsigned long);
  80065c:	8b 45 14             	mov    0x14(%ebp),%eax
  80065f:	8b 10                	mov    (%eax),%edx
  800661:	b9 00 00 00 00       	mov    $0x0,%ecx
  800666:	8d 40 04             	lea    0x4(%eax),%eax
  800669:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  80066c:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long);
  800671:	eb 9f                	jmp    800612 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  800673:	8b 45 14             	mov    0x14(%ebp),%eax
  800676:	8b 10                	mov    (%eax),%edx
  800678:	8b 48 04             	mov    0x4(%eax),%ecx
  80067b:	8d 40 08             	lea    0x8(%eax),%eax
  80067e:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  800681:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long long);
  800686:	eb 8a                	jmp    800612 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  800688:	8b 45 14             	mov    0x14(%ebp),%eax
  80068b:	8b 10                	mov    (%eax),%edx
  80068d:	b9 00 00 00 00       	mov    $0x0,%ecx
  800692:	8d 40 04             	lea    0x4(%eax),%eax
  800695:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  800698:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned int);
  80069d:	e9 70 ff ff ff       	jmp    800612 <vprintfmt+0x35b>
			putch(ch, putdat);
  8006a2:	83 ec 08             	sub    $0x8,%esp
  8006a5:	53                   	push   %ebx
  8006a6:	6a 25                	push   $0x25
  8006a8:	ff d6                	call   *%esi
			break;
  8006aa:	83 c4 10             	add    $0x10,%esp
  8006ad:	e9 7a ff ff ff       	jmp    80062c <vprintfmt+0x375>
			putch('%', putdat);
  8006b2:	83 ec 08             	sub    $0x8,%esp
  8006b5:	53                   	push   %ebx
  8006b6:	6a 25                	push   $0x25
  8006b8:	ff d6                	call   *%esi
			for (fmt--; fmt[-1] != '%'; fmt--)
  8006ba:	83 c4 10             	add    $0x10,%esp
  8006bd:	89 f8                	mov    %edi,%eax
  8006bf:	80 78 ff 25          	cmpb   $0x25,-0x1(%eax)
  8006c3:	74 05                	je     8006ca <vprintfmt+0x413>
  8006c5:	83 e8 01             	sub    $0x1,%eax
  8006c8:	eb f5                	jmp    8006bf <vprintfmt+0x408>
  8006ca:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  8006cd:	e9 5a ff ff ff       	jmp    80062c <vprintfmt+0x375>
}
  8006d2:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8006d5:	5b                   	pop    %ebx
  8006d6:	5e                   	pop    %esi
  8006d7:	5f                   	pop    %edi
  8006d8:	5d                   	pop    %ebp
  8006d9:	c3                   	ret    

008006da <vsnprintf>:

int
vsnprintf(char *buf, int n, const char *fmt, va_list ap)
{
  8006da:	f3 0f 1e fb          	endbr32 
  8006de:	55                   	push   %ebp
  8006df:	89 e5                	mov    %esp,%ebp
  8006e1:	83 ec 18             	sub    $0x18,%esp
  8006e4:	8b 45 08             	mov    0x8(%ebp),%eax
  8006e7:	8b 55 0c             	mov    0xc(%ebp),%edx
	struct sprintbuf b = {buf, buf+n-1, 0};
  8006ea:	89 45 ec             	mov    %eax,-0x14(%ebp)
  8006ed:	8d 4c 10 ff          	lea    -0x1(%eax,%edx,1),%ecx
  8006f1:	89 4d f0             	mov    %ecx,-0x10(%ebp)
  8006f4:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

	if (buf == NULL || n < 1)
  8006fb:	85 c0                	test   %eax,%eax
  8006fd:	74 26                	je     800725 <vsnprintf+0x4b>
  8006ff:	85 d2                	test   %edx,%edx
  800701:	7e 22                	jle    800725 <vsnprintf+0x4b>
		return -E_INVAL;

	// print the string to the buffer
	vprintfmt((void*)sprintputch, &b, fmt, ap);
  800703:	ff 75 14             	pushl  0x14(%ebp)
  800706:	ff 75 10             	pushl  0x10(%ebp)
  800709:	8d 45 ec             	lea    -0x14(%ebp),%eax
  80070c:	50                   	push   %eax
  80070d:	68 75 02 80 00       	push   $0x800275
  800712:	e8 a0 fb ff ff       	call   8002b7 <vprintfmt>

	// null terminate the buffer
	*b.buf = '\0';
  800717:	8b 45 ec             	mov    -0x14(%ebp),%eax
  80071a:	c6 00 00             	movb   $0x0,(%eax)

	return b.cnt;
  80071d:	8b 45 f4             	mov    -0xc(%ebp),%eax
  800720:	83 c4 10             	add    $0x10,%esp
}
  800723:	c9                   	leave  
  800724:	c3                   	ret    
		return -E_INVAL;
  800725:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  80072a:	eb f7                	jmp    800723 <vsnprintf+0x49>

0080072c <snprintf>:

int
snprintf(char *buf, int n, const char *fmt, ...)
{
  80072c:	f3 0f 1e fb          	endbr32 
  800730:	55                   	push   %ebp
  800731:	89 e5                	mov    %esp,%ebp
  800733:	83 ec 08             	sub    $0x8,%esp
	va_list ap;
	int rc;

	va_start(ap, fmt);
  800736:	8d 45 14             	lea    0x14(%ebp),%eax
	rc = vsnprintf(buf, n, fmt, ap);
  800739:	50                   	push   %eax
  80073a:	ff 75 10             	pushl  0x10(%ebp)
  80073d:	ff 75 0c             	pushl  0xc(%ebp)
  800740:	ff 75 08             	pushl  0x8(%ebp)
  800743:	e8 92 ff ff ff       	call   8006da <vsnprintf>
	va_end(ap);

	return rc;
}
  800748:	c9                   	leave  
  800749:	c3                   	ret    

0080074a <strlen>:
// Primespipe runs 3x faster this way.
#define ASM 1

int
strlen(const char *s)
{
  80074a:	f3 0f 1e fb          	endbr32 
  80074e:	55                   	push   %ebp
  80074f:	89 e5                	mov    %esp,%ebp
  800751:	8b 55 08             	mov    0x8(%ebp),%edx
	int n;

	for (n = 0; *s != '\0'; s++)
  800754:	b8 00 00 00 00       	mov    $0x0,%eax
  800759:	80 3c 02 00          	cmpb   $0x0,(%edx,%eax,1)
  80075d:	74 05                	je     800764 <strlen+0x1a>
		n++;
  80075f:	83 c0 01             	add    $0x1,%eax
  800762:	eb f5                	jmp    800759 <strlen+0xf>
	return n;
}
  800764:	5d                   	pop    %ebp
  800765:	c3                   	ret    

00800766 <strnlen>:

int
strnlen(const char *s, size_t size)
{
  800766:	f3 0f 1e fb          	endbr32 
  80076a:	55                   	push   %ebp
  80076b:	89 e5                	mov    %esp,%ebp
  80076d:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800770:	8b 55 0c             	mov    0xc(%ebp),%edx
	int n;

	for (n = 0; size > 0 && *s != '\0'; s++, size--)
  800773:	b8 00 00 00 00       	mov    $0x0,%eax
  800778:	39 d0                	cmp    %edx,%eax
  80077a:	74 0d                	je     800789 <strnlen+0x23>
  80077c:	80 3c 01 00          	cmpb   $0x0,(%ecx,%eax,1)
  800780:	74 05                	je     800787 <strnlen+0x21>
		n++;
  800782:	83 c0 01             	add    $0x1,%eax
  800785:	eb f1                	jmp    800778 <strnlen+0x12>
  800787:	89 c2                	mov    %eax,%edx
	return n;
}
  800789:	89 d0                	mov    %edx,%eax
  80078b:	5d                   	pop    %ebp
  80078c:	c3                   	ret    

0080078d <strcpy>:

char *
strcpy(char *dst, const char *src)
{
  80078d:	f3 0f 1e fb          	endbr32 
  800791:	55                   	push   %ebp
  800792:	89 e5                	mov    %esp,%ebp
  800794:	53                   	push   %ebx
  800795:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800798:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	char *ret;

	ret = dst;
	while ((*dst++ = *src++) != '\0')
  80079b:	b8 00 00 00 00       	mov    $0x0,%eax
  8007a0:	0f b6 14 03          	movzbl (%ebx,%eax,1),%edx
  8007a4:	88 14 01             	mov    %dl,(%ecx,%eax,1)
  8007a7:	83 c0 01             	add    $0x1,%eax
  8007aa:	84 d2                	test   %dl,%dl
  8007ac:	75 f2                	jne    8007a0 <strcpy+0x13>
		/* do nothing */;
	return ret;
}
  8007ae:	89 c8                	mov    %ecx,%eax
  8007b0:	5b                   	pop    %ebx
  8007b1:	5d                   	pop    %ebp
  8007b2:	c3                   	ret    

008007b3 <strcat>:

char *
strcat(char *dst, const char *src)
{
  8007b3:	f3 0f 1e fb          	endbr32 
  8007b7:	55                   	push   %ebp
  8007b8:	89 e5                	mov    %esp,%ebp
  8007ba:	53                   	push   %ebx
  8007bb:	83 ec 10             	sub    $0x10,%esp
  8007be:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int len = strlen(dst);
  8007c1:	53                   	push   %ebx
  8007c2:	e8 83 ff ff ff       	call   80074a <strlen>
  8007c7:	83 c4 08             	add    $0x8,%esp
	strcpy(dst + len, src);
  8007ca:	ff 75 0c             	pushl  0xc(%ebp)
  8007cd:	01 d8                	add    %ebx,%eax
  8007cf:	50                   	push   %eax
  8007d0:	e8 b8 ff ff ff       	call   80078d <strcpy>
	return dst;
}
  8007d5:	89 d8                	mov    %ebx,%eax
  8007d7:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8007da:	c9                   	leave  
  8007db:	c3                   	ret    

008007dc <strncpy>:

char *
strncpy(char *dst, const char *src, size_t size) {
  8007dc:	f3 0f 1e fb          	endbr32 
  8007e0:	55                   	push   %ebp
  8007e1:	89 e5                	mov    %esp,%ebp
  8007e3:	56                   	push   %esi
  8007e4:	53                   	push   %ebx
  8007e5:	8b 75 08             	mov    0x8(%ebp),%esi
  8007e8:	8b 55 0c             	mov    0xc(%ebp),%edx
  8007eb:	89 f3                	mov    %esi,%ebx
  8007ed:	03 5d 10             	add    0x10(%ebp),%ebx
	size_t i;
	char *ret;

	ret = dst;
	for (i = 0; i < size; i++) {
  8007f0:	89 f0                	mov    %esi,%eax
  8007f2:	39 d8                	cmp    %ebx,%eax
  8007f4:	74 11                	je     800807 <strncpy+0x2b>
		*dst++ = *src;
  8007f6:	83 c0 01             	add    $0x1,%eax
  8007f9:	0f b6 0a             	movzbl (%edx),%ecx
  8007fc:	88 48 ff             	mov    %cl,-0x1(%eax)
		// If strlen(src) < size, null-pad 'dst' out to 'size' chars
		if (*src != '\0')
			src++;
  8007ff:	80 f9 01             	cmp    $0x1,%cl
  800802:	83 da ff             	sbb    $0xffffffff,%edx
  800805:	eb eb                	jmp    8007f2 <strncpy+0x16>
	}
	return ret;
}
  800807:	89 f0                	mov    %esi,%eax
  800809:	5b                   	pop    %ebx
  80080a:	5e                   	pop    %esi
  80080b:	5d                   	pop    %ebp
  80080c:	c3                   	ret    

0080080d <strlcpy>:

size_t
strlcpy(char *dst, const char *src, size_t size)
{
  80080d:	f3 0f 1e fb          	endbr32 
  800811:	55                   	push   %ebp
  800812:	89 e5                	mov    %esp,%ebp
  800814:	56                   	push   %esi
  800815:	53                   	push   %ebx
  800816:	8b 75 08             	mov    0x8(%ebp),%esi
  800819:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  80081c:	8b 55 10             	mov    0x10(%ebp),%edx
  80081f:	89 f0                	mov    %esi,%eax
	char *dst_in;

	dst_in = dst;
	if (size > 0) {
  800821:	85 d2                	test   %edx,%edx
  800823:	74 21                	je     800846 <strlcpy+0x39>
  800825:	8d 44 16 ff          	lea    -0x1(%esi,%edx,1),%eax
  800829:	89 f2                	mov    %esi,%edx
		while (--size > 0 && *src != '\0')
  80082b:	39 c2                	cmp    %eax,%edx
  80082d:	74 14                	je     800843 <strlcpy+0x36>
  80082f:	0f b6 19             	movzbl (%ecx),%ebx
  800832:	84 db                	test   %bl,%bl
  800834:	74 0b                	je     800841 <strlcpy+0x34>
			*dst++ = *src++;
  800836:	83 c1 01             	add    $0x1,%ecx
  800839:	83 c2 01             	add    $0x1,%edx
  80083c:	88 5a ff             	mov    %bl,-0x1(%edx)
  80083f:	eb ea                	jmp    80082b <strlcpy+0x1e>
  800841:	89 d0                	mov    %edx,%eax
		*dst = '\0';
  800843:	c6 00 00             	movb   $0x0,(%eax)
	}
	return dst - dst_in;
  800846:	29 f0                	sub    %esi,%eax
}
  800848:	5b                   	pop    %ebx
  800849:	5e                   	pop    %esi
  80084a:	5d                   	pop    %ebp
  80084b:	c3                   	ret    

0080084c <strcmp>:

int
strcmp(const char *p, const char *q)
{
  80084c:	f3 0f 1e fb          	endbr32 
  800850:	55                   	push   %ebp
  800851:	89 e5                	mov    %esp,%ebp
  800853:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800856:	8b 55 0c             	mov    0xc(%ebp),%edx
	while (*p && *p == *q)
  800859:	0f b6 01             	movzbl (%ecx),%eax
  80085c:	84 c0                	test   %al,%al
  80085e:	74 0c                	je     80086c <strcmp+0x20>
  800860:	3a 02                	cmp    (%edx),%al
  800862:	75 08                	jne    80086c <strcmp+0x20>
		p++, q++;
  800864:	83 c1 01             	add    $0x1,%ecx
  800867:	83 c2 01             	add    $0x1,%edx
  80086a:	eb ed                	jmp    800859 <strcmp+0xd>
	return (int) ((unsigned char) *p - (unsigned char) *q);
  80086c:	0f b6 c0             	movzbl %al,%eax
  80086f:	0f b6 12             	movzbl (%edx),%edx
  800872:	29 d0                	sub    %edx,%eax
}
  800874:	5d                   	pop    %ebp
  800875:	c3                   	ret    

00800876 <strncmp>:

int
strncmp(const char *p, const char *q, size_t n)
{
  800876:	f3 0f 1e fb          	endbr32 
  80087a:	55                   	push   %ebp
  80087b:	89 e5                	mov    %esp,%ebp
  80087d:	53                   	push   %ebx
  80087e:	8b 45 08             	mov    0x8(%ebp),%eax
  800881:	8b 55 0c             	mov    0xc(%ebp),%edx
  800884:	89 c3                	mov    %eax,%ebx
  800886:	03 5d 10             	add    0x10(%ebp),%ebx
	while (n > 0 && *p && *p == *q)
  800889:	eb 06                	jmp    800891 <strncmp+0x1b>
		n--, p++, q++;
  80088b:	83 c0 01             	add    $0x1,%eax
  80088e:	83 c2 01             	add    $0x1,%edx
	while (n > 0 && *p && *p == *q)
  800891:	39 d8                	cmp    %ebx,%eax
  800893:	74 16                	je     8008ab <strncmp+0x35>
  800895:	0f b6 08             	movzbl (%eax),%ecx
  800898:	84 c9                	test   %cl,%cl
  80089a:	74 04                	je     8008a0 <strncmp+0x2a>
  80089c:	3a 0a                	cmp    (%edx),%cl
  80089e:	74 eb                	je     80088b <strncmp+0x15>
	if (n == 0)
		return 0;
	else
		return (int) ((unsigned char) *p - (unsigned char) *q);
  8008a0:	0f b6 00             	movzbl (%eax),%eax
  8008a3:	0f b6 12             	movzbl (%edx),%edx
  8008a6:	29 d0                	sub    %edx,%eax
}
  8008a8:	5b                   	pop    %ebx
  8008a9:	5d                   	pop    %ebp
  8008aa:	c3                   	ret    
		return 0;
  8008ab:	b8 00 00 00 00       	mov    $0x0,%eax
  8008b0:	eb f6                	jmp    8008a8 <strncmp+0x32>

008008b2 <strchr>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a null pointer if the string has no 'c'.
char *
strchr(const char *s, char c)
{
  8008b2:	f3 0f 1e fb          	endbr32 
  8008b6:	55                   	push   %ebp
  8008b7:	89 e5                	mov    %esp,%ebp
  8008b9:	8b 45 08             	mov    0x8(%ebp),%eax
  8008bc:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  8008c0:	0f b6 10             	movzbl (%eax),%edx
  8008c3:	84 d2                	test   %dl,%dl
  8008c5:	74 09                	je     8008d0 <strchr+0x1e>
		if (*s == c)
  8008c7:	38 ca                	cmp    %cl,%dl
  8008c9:	74 0a                	je     8008d5 <strchr+0x23>
	for (; *s; s++)
  8008cb:	83 c0 01             	add    $0x1,%eax
  8008ce:	eb f0                	jmp    8008c0 <strchr+0xe>
			return (char *) s;
	return 0;
  8008d0:	b8 00 00 00 00       	mov    $0x0,%eax
}
  8008d5:	5d                   	pop    %ebp
  8008d6:	c3                   	ret    

008008d7 <strfind>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a pointer to the string-ending null character if the string has no 'c'.
char *
strfind(const char *s, char c)
{
  8008d7:	f3 0f 1e fb          	endbr32 
  8008db:	55                   	push   %ebp
  8008dc:	89 e5                	mov    %esp,%ebp
  8008de:	8b 45 08             	mov    0x8(%ebp),%eax
  8008e1:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  8008e5:	0f b6 10             	movzbl (%eax),%edx
		if (*s == c)
  8008e8:	38 ca                	cmp    %cl,%dl
  8008ea:	74 09                	je     8008f5 <strfind+0x1e>
  8008ec:	84 d2                	test   %dl,%dl
  8008ee:	74 05                	je     8008f5 <strfind+0x1e>
	for (; *s; s++)
  8008f0:	83 c0 01             	add    $0x1,%eax
  8008f3:	eb f0                	jmp    8008e5 <strfind+0xe>
			break;
	return (char *) s;
}
  8008f5:	5d                   	pop    %ebp
  8008f6:	c3                   	ret    

008008f7 <memset>:

#if ASM
void *
memset(void *v, int c, size_t n)
{
  8008f7:	f3 0f 1e fb          	endbr32 
  8008fb:	55                   	push   %ebp
  8008fc:	89 e5                	mov    %esp,%ebp
  8008fe:	57                   	push   %edi
  8008ff:	56                   	push   %esi
  800900:	53                   	push   %ebx
  800901:	8b 7d 08             	mov    0x8(%ebp),%edi
  800904:	8b 4d 10             	mov    0x10(%ebp),%ecx
	char *p;

	if (n == 0)
  800907:	85 c9                	test   %ecx,%ecx
  800909:	74 31                	je     80093c <memset+0x45>
		return v;
	if ((int)v%4 == 0 && n%4 == 0) {
  80090b:	89 f8                	mov    %edi,%eax
  80090d:	09 c8                	or     %ecx,%eax
  80090f:	a8 03                	test   $0x3,%al
  800911:	75 23                	jne    800936 <memset+0x3f>
		c &= 0xFF;
  800913:	0f b6 55 0c          	movzbl 0xc(%ebp),%edx
		c = (c<<24)|(c<<16)|(c<<8)|c;
  800917:	89 d3                	mov    %edx,%ebx
  800919:	c1 e3 08             	shl    $0x8,%ebx
  80091c:	89 d0                	mov    %edx,%eax
  80091e:	c1 e0 18             	shl    $0x18,%eax
  800921:	89 d6                	mov    %edx,%esi
  800923:	c1 e6 10             	shl    $0x10,%esi
  800926:	09 f0                	or     %esi,%eax
  800928:	09 c2                	or     %eax,%edx
  80092a:	09 da                	or     %ebx,%edx
		asm volatile("cld; rep stosl\n"
			:: "D" (v), "a" (c), "c" (n/4)
  80092c:	c1 e9 02             	shr    $0x2,%ecx
		asm volatile("cld; rep stosl\n"
  80092f:	89 d0                	mov    %edx,%eax
  800931:	fc                   	cld    
  800932:	f3 ab                	rep stos %eax,%es:(%edi)
  800934:	eb 06                	jmp    80093c <memset+0x45>
			: "cc", "memory");
	} else
		asm volatile("cld; rep stosb\n"
  800936:	8b 45 0c             	mov    0xc(%ebp),%eax
  800939:	fc                   	cld    
  80093a:	f3 aa                	rep stos %al,%es:(%edi)
			:: "D" (v), "a" (c), "c" (n)
			: "cc", "memory");
	return v;
}
  80093c:	89 f8                	mov    %edi,%eax
  80093e:	5b                   	pop    %ebx
  80093f:	5e                   	pop    %esi
  800940:	5f                   	pop    %edi
  800941:	5d                   	pop    %ebp
  800942:	c3                   	ret    

00800943 <memmove>:

void *
memmove(void *dst, const void *src, size_t n)
{
  800943:	f3 0f 1e fb          	endbr32 
  800947:	55                   	push   %ebp
  800948:	89 e5                	mov    %esp,%ebp
  80094a:	57                   	push   %edi
  80094b:	56                   	push   %esi
  80094c:	8b 45 08             	mov    0x8(%ebp),%eax
  80094f:	8b 75 0c             	mov    0xc(%ebp),%esi
  800952:	8b 4d 10             	mov    0x10(%ebp),%ecx
	const char *s;
	char *d;

	s = src;
	d = dst;
	if (s < d && s + n > d) {
  800955:	39 c6                	cmp    %eax,%esi
  800957:	73 32                	jae    80098b <memmove+0x48>
  800959:	8d 14 0e             	lea    (%esi,%ecx,1),%edx
  80095c:	39 c2                	cmp    %eax,%edx
  80095e:	76 2b                	jbe    80098b <memmove+0x48>
		s += n;
		d += n;
  800960:	8d 3c 08             	lea    (%eax,%ecx,1),%edi
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  800963:	89 fe                	mov    %edi,%esi
  800965:	09 ce                	or     %ecx,%esi
  800967:	09 d6                	or     %edx,%esi
  800969:	f7 c6 03 00 00 00    	test   $0x3,%esi
  80096f:	75 0e                	jne    80097f <memmove+0x3c>
			asm volatile("std; rep movsl\n"
				:: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory");
  800971:	83 ef 04             	sub    $0x4,%edi
  800974:	8d 72 fc             	lea    -0x4(%edx),%esi
  800977:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("std; rep movsl\n"
  80097a:	fd                   	std    
  80097b:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  80097d:	eb 09                	jmp    800988 <memmove+0x45>
		else
			asm volatile("std; rep movsb\n"
				:: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory");
  80097f:	83 ef 01             	sub    $0x1,%edi
  800982:	8d 72 ff             	lea    -0x1(%edx),%esi
			asm volatile("std; rep movsb\n"
  800985:	fd                   	std    
  800986:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
		// Some versions of GCC rely on DF being clear
		asm volatile("cld" ::: "cc");
  800988:	fc                   	cld    
  800989:	eb 1a                	jmp    8009a5 <memmove+0x62>
	} else {
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  80098b:	89 c2                	mov    %eax,%edx
  80098d:	09 ca                	or     %ecx,%edx
  80098f:	09 f2                	or     %esi,%edx
  800991:	f6 c2 03             	test   $0x3,%dl
  800994:	75 0a                	jne    8009a0 <memmove+0x5d>
			asm volatile("cld; rep movsl\n"
				:: "D" (d), "S" (s), "c" (n/4) : "cc", "memory");
  800996:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("cld; rep movsl\n"
  800999:	89 c7                	mov    %eax,%edi
  80099b:	fc                   	cld    
  80099c:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  80099e:	eb 05                	jmp    8009a5 <memmove+0x62>
		else
			asm volatile("cld; rep movsb\n"
  8009a0:	89 c7                	mov    %eax,%edi
  8009a2:	fc                   	cld    
  8009a3:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
				:: "D" (d), "S" (s), "c" (n) : "cc", "memory");
	}
	return dst;
}
  8009a5:	5e                   	pop    %esi
  8009a6:	5f                   	pop    %edi
  8009a7:	5d                   	pop    %ebp
  8009a8:	c3                   	ret    

008009a9 <memcpy>:
}
#endif

void *
memcpy(void *dst, const void *src, size_t n)
{
  8009a9:	f3 0f 1e fb          	endbr32 
  8009ad:	55                   	push   %ebp
  8009ae:	89 e5                	mov    %esp,%ebp
  8009b0:	83 ec 0c             	sub    $0xc,%esp
	return memmove(dst, src, n);
  8009b3:	ff 75 10             	pushl  0x10(%ebp)
  8009b6:	ff 75 0c             	pushl  0xc(%ebp)
  8009b9:	ff 75 08             	pushl  0x8(%ebp)
  8009bc:	e8 82 ff ff ff       	call   800943 <memmove>
}
  8009c1:	c9                   	leave  
  8009c2:	c3                   	ret    

008009c3 <memcmp>:

int
memcmp(const void *v1, const void *v2, size_t n)
{
  8009c3:	f3 0f 1e fb          	endbr32 
  8009c7:	55                   	push   %ebp
  8009c8:	89 e5                	mov    %esp,%ebp
  8009ca:	56                   	push   %esi
  8009cb:	53                   	push   %ebx
  8009cc:	8b 45 08             	mov    0x8(%ebp),%eax
  8009cf:	8b 55 0c             	mov    0xc(%ebp),%edx
  8009d2:	89 c6                	mov    %eax,%esi
  8009d4:	03 75 10             	add    0x10(%ebp),%esi
	const uint8_t *s1 = (const uint8_t *) v1;
	const uint8_t *s2 = (const uint8_t *) v2;

	while (n-- > 0) {
  8009d7:	39 f0                	cmp    %esi,%eax
  8009d9:	74 1c                	je     8009f7 <memcmp+0x34>
		if (*s1 != *s2)
  8009db:	0f b6 08             	movzbl (%eax),%ecx
  8009de:	0f b6 1a             	movzbl (%edx),%ebx
  8009e1:	38 d9                	cmp    %bl,%cl
  8009e3:	75 08                	jne    8009ed <memcmp+0x2a>
			return (int) *s1 - (int) *s2;
		s1++, s2++;
  8009e5:	83 c0 01             	add    $0x1,%eax
  8009e8:	83 c2 01             	add    $0x1,%edx
  8009eb:	eb ea                	jmp    8009d7 <memcmp+0x14>
			return (int) *s1 - (int) *s2;
  8009ed:	0f b6 c1             	movzbl %cl,%eax
  8009f0:	0f b6 db             	movzbl %bl,%ebx
  8009f3:	29 d8                	sub    %ebx,%eax
  8009f5:	eb 05                	jmp    8009fc <memcmp+0x39>
	}

	return 0;
  8009f7:	b8 00 00 00 00       	mov    $0x0,%eax
}
  8009fc:	5b                   	pop    %ebx
  8009fd:	5e                   	pop    %esi
  8009fe:	5d                   	pop    %ebp
  8009ff:	c3                   	ret    

00800a00 <memfind>:

void *
memfind(const void *s, int c, size_t n)
{
  800a00:	f3 0f 1e fb          	endbr32 
  800a04:	55                   	push   %ebp
  800a05:	89 e5                	mov    %esp,%ebp
  800a07:	8b 45 08             	mov    0x8(%ebp),%eax
  800a0a:	8b 4d 0c             	mov    0xc(%ebp),%ecx
	const void *ends = (const char *) s + n;
  800a0d:	89 c2                	mov    %eax,%edx
  800a0f:	03 55 10             	add    0x10(%ebp),%edx
	for (; s < ends; s++)
  800a12:	39 d0                	cmp    %edx,%eax
  800a14:	73 09                	jae    800a1f <memfind+0x1f>
		if (*(const unsigned char *) s == (unsigned char) c)
  800a16:	38 08                	cmp    %cl,(%eax)
  800a18:	74 05                	je     800a1f <memfind+0x1f>
	for (; s < ends; s++)
  800a1a:	83 c0 01             	add    $0x1,%eax
  800a1d:	eb f3                	jmp    800a12 <memfind+0x12>
			break;
	return (void *) s;
}
  800a1f:	5d                   	pop    %ebp
  800a20:	c3                   	ret    

00800a21 <strtol>:

long
strtol(const char *s, char **endptr, int base)
{
  800a21:	f3 0f 1e fb          	endbr32 
  800a25:	55                   	push   %ebp
  800a26:	89 e5                	mov    %esp,%ebp
  800a28:	57                   	push   %edi
  800a29:	56                   	push   %esi
  800a2a:	53                   	push   %ebx
  800a2b:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800a2e:	8b 5d 10             	mov    0x10(%ebp),%ebx
	int neg = 0;
	long val = 0;

	// gobble initial whitespace
	while (*s == ' ' || *s == '\t')
  800a31:	eb 03                	jmp    800a36 <strtol+0x15>
		s++;
  800a33:	83 c1 01             	add    $0x1,%ecx
	while (*s == ' ' || *s == '\t')
  800a36:	0f b6 01             	movzbl (%ecx),%eax
  800a39:	3c 20                	cmp    $0x20,%al
  800a3b:	74 f6                	je     800a33 <strtol+0x12>
  800a3d:	3c 09                	cmp    $0x9,%al
  800a3f:	74 f2                	je     800a33 <strtol+0x12>

	// plus/minus sign
	if (*s == '+')
  800a41:	3c 2b                	cmp    $0x2b,%al
  800a43:	74 2a                	je     800a6f <strtol+0x4e>
	int neg = 0;
  800a45:	bf 00 00 00 00       	mov    $0x0,%edi
		s++;
	else if (*s == '-')
  800a4a:	3c 2d                	cmp    $0x2d,%al
  800a4c:	74 2b                	je     800a79 <strtol+0x58>
		s++, neg = 1;

	// hex or octal base prefix
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800a4e:	f7 c3 ef ff ff ff    	test   $0xffffffef,%ebx
  800a54:	75 0f                	jne    800a65 <strtol+0x44>
  800a56:	80 39 30             	cmpb   $0x30,(%ecx)
  800a59:	74 28                	je     800a83 <strtol+0x62>
		s += 2, base = 16;
	else if (base == 0 && s[0] == '0')
		s++, base = 8;
	else if (base == 0)
		base = 10;
  800a5b:	85 db                	test   %ebx,%ebx
  800a5d:	b8 0a 00 00 00       	mov    $0xa,%eax
  800a62:	0f 44 d8             	cmove  %eax,%ebx
  800a65:	b8 00 00 00 00       	mov    $0x0,%eax
  800a6a:	89 5d 10             	mov    %ebx,0x10(%ebp)
  800a6d:	eb 46                	jmp    800ab5 <strtol+0x94>
		s++;
  800a6f:	83 c1 01             	add    $0x1,%ecx
	int neg = 0;
  800a72:	bf 00 00 00 00       	mov    $0x0,%edi
  800a77:	eb d5                	jmp    800a4e <strtol+0x2d>
		s++, neg = 1;
  800a79:	83 c1 01             	add    $0x1,%ecx
  800a7c:	bf 01 00 00 00       	mov    $0x1,%edi
  800a81:	eb cb                	jmp    800a4e <strtol+0x2d>
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800a83:	80 79 01 78          	cmpb   $0x78,0x1(%ecx)
  800a87:	74 0e                	je     800a97 <strtol+0x76>
	else if (base == 0 && s[0] == '0')
  800a89:	85 db                	test   %ebx,%ebx
  800a8b:	75 d8                	jne    800a65 <strtol+0x44>
		s++, base = 8;
  800a8d:	83 c1 01             	add    $0x1,%ecx
  800a90:	bb 08 00 00 00       	mov    $0x8,%ebx
  800a95:	eb ce                	jmp    800a65 <strtol+0x44>
		s += 2, base = 16;
  800a97:	83 c1 02             	add    $0x2,%ecx
  800a9a:	bb 10 00 00 00       	mov    $0x10,%ebx
  800a9f:	eb c4                	jmp    800a65 <strtol+0x44>
	// digits
	while (1) {
		int dig;

		if (*s >= '0' && *s <= '9')
			dig = *s - '0';
  800aa1:	0f be d2             	movsbl %dl,%edx
  800aa4:	83 ea 30             	sub    $0x30,%edx
			dig = *s - 'a' + 10;
		else if (*s >= 'A' && *s <= 'Z')
			dig = *s - 'A' + 10;
		else
			break;
		if (dig >= base)
  800aa7:	3b 55 10             	cmp    0x10(%ebp),%edx
  800aaa:	7d 3a                	jge    800ae6 <strtol+0xc5>
			break;
		s++, val = (val * base) + dig;
  800aac:	83 c1 01             	add    $0x1,%ecx
  800aaf:	0f af 45 10          	imul   0x10(%ebp),%eax
  800ab3:	01 d0                	add    %edx,%eax
		if (*s >= '0' && *s <= '9')
  800ab5:	0f b6 11             	movzbl (%ecx),%edx
  800ab8:	8d 72 d0             	lea    -0x30(%edx),%esi
  800abb:	89 f3                	mov    %esi,%ebx
  800abd:	80 fb 09             	cmp    $0x9,%bl
  800ac0:	76 df                	jbe    800aa1 <strtol+0x80>
		else if (*s >= 'a' && *s <= 'z')
  800ac2:	8d 72 9f             	lea    -0x61(%edx),%esi
  800ac5:	89 f3                	mov    %esi,%ebx
  800ac7:	80 fb 19             	cmp    $0x19,%bl
  800aca:	77 08                	ja     800ad4 <strtol+0xb3>
			dig = *s - 'a' + 10;
  800acc:	0f be d2             	movsbl %dl,%edx
  800acf:	83 ea 57             	sub    $0x57,%edx
  800ad2:	eb d3                	jmp    800aa7 <strtol+0x86>
		else if (*s >= 'A' && *s <= 'Z')
  800ad4:	8d 72 bf             	lea    -0x41(%edx),%esi
  800ad7:	89 f3                	mov    %esi,%ebx
  800ad9:	80 fb 19             	cmp    $0x19,%bl
  800adc:	77 08                	ja     800ae6 <strtol+0xc5>
			dig = *s - 'A' + 10;
  800ade:	0f be d2             	movsbl %dl,%edx
  800ae1:	83 ea 37             	sub    $0x37,%edx
  800ae4:	eb c1                	jmp    800aa7 <strtol+0x86>
		// we don't properly detect overflow!
	}

	if (endptr)
  800ae6:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  800aea:	74 05                	je     800af1 <strtol+0xd0>
		*endptr = (char *) s;
  800aec:	8b 75 0c             	mov    0xc(%ebp),%esi
  800aef:	89 0e                	mov    %ecx,(%esi)
	return (neg ? -val : val);
  800af1:	89 c2                	mov    %eax,%edx
  800af3:	f7 da                	neg    %edx
  800af5:	85 ff                	test   %edi,%edi
  800af7:	0f 45 c2             	cmovne %edx,%eax
}
  800afa:	5b                   	pop    %ebx
  800afb:	5e                   	pop    %esi
  800afc:	5f                   	pop    %edi
  800afd:	5d                   	pop    %ebp
  800afe:	c3                   	ret    

00800aff <sys_cputs>:
	return ret;
}

void
sys_cputs(const char *s, size_t len)
{
  800aff:	f3 0f 1e fb          	endbr32 
  800b03:	55                   	push   %ebp
  800b04:	89 e5                	mov    %esp,%ebp
  800b06:	57                   	push   %edi
  800b07:	56                   	push   %esi
  800b08:	53                   	push   %ebx
	asm volatile("int %1\n"
  800b09:	b8 00 00 00 00       	mov    $0x0,%eax
  800b0e:	8b 55 08             	mov    0x8(%ebp),%edx
  800b11:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800b14:	89 c3                	mov    %eax,%ebx
  800b16:	89 c7                	mov    %eax,%edi
  800b18:	89 c6                	mov    %eax,%esi
  800b1a:	cd 30                	int    $0x30
	syscall(SYS_cputs, 0, (uint32_t)s, len, 0, 0, 0);
}
  800b1c:	5b                   	pop    %ebx
  800b1d:	5e                   	pop    %esi
  800b1e:	5f                   	pop    %edi
  800b1f:	5d                   	pop    %ebp
  800b20:	c3                   	ret    

00800b21 <sys_cgetc>:

int
sys_cgetc(void)
{
  800b21:	f3 0f 1e fb          	endbr32 
  800b25:	55                   	push   %ebp
  800b26:	89 e5                	mov    %esp,%ebp
  800b28:	57                   	push   %edi
  800b29:	56                   	push   %esi
  800b2a:	53                   	push   %ebx
	asm volatile("int %1\n"
  800b2b:	ba 00 00 00 00       	mov    $0x0,%edx
  800b30:	b8 01 00 00 00       	mov    $0x1,%eax
  800b35:	89 d1                	mov    %edx,%ecx
  800b37:	89 d3                	mov    %edx,%ebx
  800b39:	89 d7                	mov    %edx,%edi
  800b3b:	89 d6                	mov    %edx,%esi
  800b3d:	cd 30                	int    $0x30
	return syscall(SYS_cgetc, 0, 0, 0, 0, 0, 0);
}
  800b3f:	5b                   	pop    %ebx
  800b40:	5e                   	pop    %esi
  800b41:	5f                   	pop    %edi
  800b42:	5d                   	pop    %ebp
  800b43:	c3                   	ret    

00800b44 <sys_env_destroy>:

int
sys_env_destroy(envid_t envid)
{
  800b44:	f3 0f 1e fb          	endbr32 
  800b48:	55                   	push   %ebp
  800b49:	89 e5                	mov    %esp,%ebp
  800b4b:	57                   	push   %edi
  800b4c:	56                   	push   %esi
  800b4d:	53                   	push   %ebx
  800b4e:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800b51:	b9 00 00 00 00       	mov    $0x0,%ecx
  800b56:	8b 55 08             	mov    0x8(%ebp),%edx
  800b59:	b8 03 00 00 00       	mov    $0x3,%eax
  800b5e:	89 cb                	mov    %ecx,%ebx
  800b60:	89 cf                	mov    %ecx,%edi
  800b62:	89 ce                	mov    %ecx,%esi
  800b64:	cd 30                	int    $0x30
	if(check && ret > 0)
  800b66:	85 c0                	test   %eax,%eax
  800b68:	7f 08                	jg     800b72 <sys_env_destroy+0x2e>
	return syscall(SYS_env_destroy, 1, envid, 0, 0, 0, 0);
}
  800b6a:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800b6d:	5b                   	pop    %ebx
  800b6e:	5e                   	pop    %esi
  800b6f:	5f                   	pop    %edi
  800b70:	5d                   	pop    %ebp
  800b71:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800b72:	83 ec 0c             	sub    $0xc,%esp
  800b75:	50                   	push   %eax
  800b76:	6a 03                	push   $0x3
  800b78:	68 7f 22 80 00       	push   $0x80227f
  800b7d:	6a 23                	push   $0x23
  800b7f:	68 9c 22 80 00       	push   $0x80229c
  800b84:	e8 b2 10 00 00       	call   801c3b <_panic>

00800b89 <sys_getenvid>:

envid_t
sys_getenvid(void)
{
  800b89:	f3 0f 1e fb          	endbr32 
  800b8d:	55                   	push   %ebp
  800b8e:	89 e5                	mov    %esp,%ebp
  800b90:	57                   	push   %edi
  800b91:	56                   	push   %esi
  800b92:	53                   	push   %ebx
	asm volatile("int %1\n"
  800b93:	ba 00 00 00 00       	mov    $0x0,%edx
  800b98:	b8 02 00 00 00       	mov    $0x2,%eax
  800b9d:	89 d1                	mov    %edx,%ecx
  800b9f:	89 d3                	mov    %edx,%ebx
  800ba1:	89 d7                	mov    %edx,%edi
  800ba3:	89 d6                	mov    %edx,%esi
  800ba5:	cd 30                	int    $0x30
	 return syscall(SYS_getenvid, 0, 0, 0, 0, 0, 0);
}
  800ba7:	5b                   	pop    %ebx
  800ba8:	5e                   	pop    %esi
  800ba9:	5f                   	pop    %edi
  800baa:	5d                   	pop    %ebp
  800bab:	c3                   	ret    

00800bac <sys_yield>:

void
sys_yield(void)
{
  800bac:	f3 0f 1e fb          	endbr32 
  800bb0:	55                   	push   %ebp
  800bb1:	89 e5                	mov    %esp,%ebp
  800bb3:	57                   	push   %edi
  800bb4:	56                   	push   %esi
  800bb5:	53                   	push   %ebx
	asm volatile("int %1\n"
  800bb6:	ba 00 00 00 00       	mov    $0x0,%edx
  800bbb:	b8 0b 00 00 00       	mov    $0xb,%eax
  800bc0:	89 d1                	mov    %edx,%ecx
  800bc2:	89 d3                	mov    %edx,%ebx
  800bc4:	89 d7                	mov    %edx,%edi
  800bc6:	89 d6                	mov    %edx,%esi
  800bc8:	cd 30                	int    $0x30
	syscall(SYS_yield, 0, 0, 0, 0, 0, 0);
}
  800bca:	5b                   	pop    %ebx
  800bcb:	5e                   	pop    %esi
  800bcc:	5f                   	pop    %edi
  800bcd:	5d                   	pop    %ebp
  800bce:	c3                   	ret    

00800bcf <sys_page_alloc>:

int
sys_page_alloc(envid_t envid, void *va, int perm)
{
  800bcf:	f3 0f 1e fb          	endbr32 
  800bd3:	55                   	push   %ebp
  800bd4:	89 e5                	mov    %esp,%ebp
  800bd6:	57                   	push   %edi
  800bd7:	56                   	push   %esi
  800bd8:	53                   	push   %ebx
  800bd9:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800bdc:	be 00 00 00 00       	mov    $0x0,%esi
  800be1:	8b 55 08             	mov    0x8(%ebp),%edx
  800be4:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800be7:	b8 04 00 00 00       	mov    $0x4,%eax
  800bec:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800bef:	89 f7                	mov    %esi,%edi
  800bf1:	cd 30                	int    $0x30
	if(check && ret > 0)
  800bf3:	85 c0                	test   %eax,%eax
  800bf5:	7f 08                	jg     800bff <sys_page_alloc+0x30>
	return syscall(SYS_page_alloc, 1, envid, (uint32_t) va, perm, 0, 0);
}
  800bf7:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800bfa:	5b                   	pop    %ebx
  800bfb:	5e                   	pop    %esi
  800bfc:	5f                   	pop    %edi
  800bfd:	5d                   	pop    %ebp
  800bfe:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800bff:	83 ec 0c             	sub    $0xc,%esp
  800c02:	50                   	push   %eax
  800c03:	6a 04                	push   $0x4
  800c05:	68 7f 22 80 00       	push   $0x80227f
  800c0a:	6a 23                	push   $0x23
  800c0c:	68 9c 22 80 00       	push   $0x80229c
  800c11:	e8 25 10 00 00       	call   801c3b <_panic>

00800c16 <sys_page_map>:

int
sys_page_map(envid_t srcenv, void *srcva, envid_t dstenv, void *dstva, int perm)
{
  800c16:	f3 0f 1e fb          	endbr32 
  800c1a:	55                   	push   %ebp
  800c1b:	89 e5                	mov    %esp,%ebp
  800c1d:	57                   	push   %edi
  800c1e:	56                   	push   %esi
  800c1f:	53                   	push   %ebx
  800c20:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800c23:	8b 55 08             	mov    0x8(%ebp),%edx
  800c26:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800c29:	b8 05 00 00 00       	mov    $0x5,%eax
  800c2e:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800c31:	8b 7d 14             	mov    0x14(%ebp),%edi
  800c34:	8b 75 18             	mov    0x18(%ebp),%esi
  800c37:	cd 30                	int    $0x30
	if(check && ret > 0)
  800c39:	85 c0                	test   %eax,%eax
  800c3b:	7f 08                	jg     800c45 <sys_page_map+0x2f>
	return syscall(SYS_page_map, 1, srcenv, (uint32_t) srcva, dstenv, (uint32_t) dstva, perm);
}
  800c3d:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800c40:	5b                   	pop    %ebx
  800c41:	5e                   	pop    %esi
  800c42:	5f                   	pop    %edi
  800c43:	5d                   	pop    %ebp
  800c44:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800c45:	83 ec 0c             	sub    $0xc,%esp
  800c48:	50                   	push   %eax
  800c49:	6a 05                	push   $0x5
  800c4b:	68 7f 22 80 00       	push   $0x80227f
  800c50:	6a 23                	push   $0x23
  800c52:	68 9c 22 80 00       	push   $0x80229c
  800c57:	e8 df 0f 00 00       	call   801c3b <_panic>

00800c5c <sys_page_unmap>:

int
sys_page_unmap(envid_t envid, void *va)
{
  800c5c:	f3 0f 1e fb          	endbr32 
  800c60:	55                   	push   %ebp
  800c61:	89 e5                	mov    %esp,%ebp
  800c63:	57                   	push   %edi
  800c64:	56                   	push   %esi
  800c65:	53                   	push   %ebx
  800c66:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800c69:	bb 00 00 00 00       	mov    $0x0,%ebx
  800c6e:	8b 55 08             	mov    0x8(%ebp),%edx
  800c71:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800c74:	b8 06 00 00 00       	mov    $0x6,%eax
  800c79:	89 df                	mov    %ebx,%edi
  800c7b:	89 de                	mov    %ebx,%esi
  800c7d:	cd 30                	int    $0x30
	if(check && ret > 0)
  800c7f:	85 c0                	test   %eax,%eax
  800c81:	7f 08                	jg     800c8b <sys_page_unmap+0x2f>
	return syscall(SYS_page_unmap, 1, envid, (uint32_t) va, 0, 0, 0);
}
  800c83:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800c86:	5b                   	pop    %ebx
  800c87:	5e                   	pop    %esi
  800c88:	5f                   	pop    %edi
  800c89:	5d                   	pop    %ebp
  800c8a:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800c8b:	83 ec 0c             	sub    $0xc,%esp
  800c8e:	50                   	push   %eax
  800c8f:	6a 06                	push   $0x6
  800c91:	68 7f 22 80 00       	push   $0x80227f
  800c96:	6a 23                	push   $0x23
  800c98:	68 9c 22 80 00       	push   $0x80229c
  800c9d:	e8 99 0f 00 00       	call   801c3b <_panic>

00800ca2 <sys_env_set_status>:

// sys_exofork is inlined in lib.h

int
sys_env_set_status(envid_t envid, int status)
{
  800ca2:	f3 0f 1e fb          	endbr32 
  800ca6:	55                   	push   %ebp
  800ca7:	89 e5                	mov    %esp,%ebp
  800ca9:	57                   	push   %edi
  800caa:	56                   	push   %esi
  800cab:	53                   	push   %ebx
  800cac:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800caf:	bb 00 00 00 00       	mov    $0x0,%ebx
  800cb4:	8b 55 08             	mov    0x8(%ebp),%edx
  800cb7:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800cba:	b8 08 00 00 00       	mov    $0x8,%eax
  800cbf:	89 df                	mov    %ebx,%edi
  800cc1:	89 de                	mov    %ebx,%esi
  800cc3:	cd 30                	int    $0x30
	if(check && ret > 0)
  800cc5:	85 c0                	test   %eax,%eax
  800cc7:	7f 08                	jg     800cd1 <sys_env_set_status+0x2f>
	return syscall(SYS_env_set_status, 1, envid, status, 0, 0, 0);
}
  800cc9:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800ccc:	5b                   	pop    %ebx
  800ccd:	5e                   	pop    %esi
  800cce:	5f                   	pop    %edi
  800ccf:	5d                   	pop    %ebp
  800cd0:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800cd1:	83 ec 0c             	sub    $0xc,%esp
  800cd4:	50                   	push   %eax
  800cd5:	6a 08                	push   $0x8
  800cd7:	68 7f 22 80 00       	push   $0x80227f
  800cdc:	6a 23                	push   $0x23
  800cde:	68 9c 22 80 00       	push   $0x80229c
  800ce3:	e8 53 0f 00 00       	call   801c3b <_panic>

00800ce8 <sys_env_set_trapframe>:

int
sys_env_set_trapframe(envid_t envid, struct Trapframe *tf)
{
  800ce8:	f3 0f 1e fb          	endbr32 
  800cec:	55                   	push   %ebp
  800ced:	89 e5                	mov    %esp,%ebp
  800cef:	57                   	push   %edi
  800cf0:	56                   	push   %esi
  800cf1:	53                   	push   %ebx
  800cf2:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800cf5:	bb 00 00 00 00       	mov    $0x0,%ebx
  800cfa:	8b 55 08             	mov    0x8(%ebp),%edx
  800cfd:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d00:	b8 09 00 00 00       	mov    $0x9,%eax
  800d05:	89 df                	mov    %ebx,%edi
  800d07:	89 de                	mov    %ebx,%esi
  800d09:	cd 30                	int    $0x30
	if(check && ret > 0)
  800d0b:	85 c0                	test   %eax,%eax
  800d0d:	7f 08                	jg     800d17 <sys_env_set_trapframe+0x2f>
	return syscall(SYS_env_set_trapframe, 1, envid, (uint32_t) tf, 0, 0, 0);
}
  800d0f:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800d12:	5b                   	pop    %ebx
  800d13:	5e                   	pop    %esi
  800d14:	5f                   	pop    %edi
  800d15:	5d                   	pop    %ebp
  800d16:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800d17:	83 ec 0c             	sub    $0xc,%esp
  800d1a:	50                   	push   %eax
  800d1b:	6a 09                	push   $0x9
  800d1d:	68 7f 22 80 00       	push   $0x80227f
  800d22:	6a 23                	push   $0x23
  800d24:	68 9c 22 80 00       	push   $0x80229c
  800d29:	e8 0d 0f 00 00       	call   801c3b <_panic>

00800d2e <sys_env_set_pgfault_upcall>:

int
sys_env_set_pgfault_upcall(envid_t envid, void *upcall)
{
  800d2e:	f3 0f 1e fb          	endbr32 
  800d32:	55                   	push   %ebp
  800d33:	89 e5                	mov    %esp,%ebp
  800d35:	57                   	push   %edi
  800d36:	56                   	push   %esi
  800d37:	53                   	push   %ebx
  800d38:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800d3b:	bb 00 00 00 00       	mov    $0x0,%ebx
  800d40:	8b 55 08             	mov    0x8(%ebp),%edx
  800d43:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d46:	b8 0a 00 00 00       	mov    $0xa,%eax
  800d4b:	89 df                	mov    %ebx,%edi
  800d4d:	89 de                	mov    %ebx,%esi
  800d4f:	cd 30                	int    $0x30
	if(check && ret > 0)
  800d51:	85 c0                	test   %eax,%eax
  800d53:	7f 08                	jg     800d5d <sys_env_set_pgfault_upcall+0x2f>
	return syscall(SYS_env_set_pgfault_upcall, 1, envid, (uint32_t) upcall, 0, 0, 0);
}
  800d55:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800d58:	5b                   	pop    %ebx
  800d59:	5e                   	pop    %esi
  800d5a:	5f                   	pop    %edi
  800d5b:	5d                   	pop    %ebp
  800d5c:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800d5d:	83 ec 0c             	sub    $0xc,%esp
  800d60:	50                   	push   %eax
  800d61:	6a 0a                	push   $0xa
  800d63:	68 7f 22 80 00       	push   $0x80227f
  800d68:	6a 23                	push   $0x23
  800d6a:	68 9c 22 80 00       	push   $0x80229c
  800d6f:	e8 c7 0e 00 00       	call   801c3b <_panic>

00800d74 <sys_ipc_try_send>:

int
sys_ipc_try_send(envid_t envid, uint32_t value, void *srcva, int perm)
{
  800d74:	f3 0f 1e fb          	endbr32 
  800d78:	55                   	push   %ebp
  800d79:	89 e5                	mov    %esp,%ebp
  800d7b:	57                   	push   %edi
  800d7c:	56                   	push   %esi
  800d7d:	53                   	push   %ebx
	asm volatile("int %1\n"
  800d7e:	8b 55 08             	mov    0x8(%ebp),%edx
  800d81:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d84:	b8 0c 00 00 00       	mov    $0xc,%eax
  800d89:	be 00 00 00 00       	mov    $0x0,%esi
  800d8e:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800d91:	8b 7d 14             	mov    0x14(%ebp),%edi
  800d94:	cd 30                	int    $0x30
	return syscall(SYS_ipc_try_send, 0, envid, value, (uint32_t) srcva, perm, 0);
}
  800d96:	5b                   	pop    %ebx
  800d97:	5e                   	pop    %esi
  800d98:	5f                   	pop    %edi
  800d99:	5d                   	pop    %ebp
  800d9a:	c3                   	ret    

00800d9b <sys_ipc_recv>:

int
sys_ipc_recv(void *dstva)
{
  800d9b:	f3 0f 1e fb          	endbr32 
  800d9f:	55                   	push   %ebp
  800da0:	89 e5                	mov    %esp,%ebp
  800da2:	57                   	push   %edi
  800da3:	56                   	push   %esi
  800da4:	53                   	push   %ebx
  800da5:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800da8:	b9 00 00 00 00       	mov    $0x0,%ecx
  800dad:	8b 55 08             	mov    0x8(%ebp),%edx
  800db0:	b8 0d 00 00 00       	mov    $0xd,%eax
  800db5:	89 cb                	mov    %ecx,%ebx
  800db7:	89 cf                	mov    %ecx,%edi
  800db9:	89 ce                	mov    %ecx,%esi
  800dbb:	cd 30                	int    $0x30
	if(check && ret > 0)
  800dbd:	85 c0                	test   %eax,%eax
  800dbf:	7f 08                	jg     800dc9 <sys_ipc_recv+0x2e>
	return syscall(SYS_ipc_recv, 1, (uint32_t)dstva, 0, 0, 0, 0);
}
  800dc1:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800dc4:	5b                   	pop    %ebx
  800dc5:	5e                   	pop    %esi
  800dc6:	5f                   	pop    %edi
  800dc7:	5d                   	pop    %ebp
  800dc8:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800dc9:	83 ec 0c             	sub    $0xc,%esp
  800dcc:	50                   	push   %eax
  800dcd:	6a 0d                	push   $0xd
  800dcf:	68 7f 22 80 00       	push   $0x80227f
  800dd4:	6a 23                	push   $0x23
  800dd6:	68 9c 22 80 00       	push   $0x80229c
  800ddb:	e8 5b 0e 00 00       	call   801c3b <_panic>

00800de0 <ipc_recv>:
//   If 'pg' is null, pass sys_ipc_recv a value that it will understand
//   as meaning "no page".  (Zero is not the right value, since that's
//   a perfectly valid place to map a page.)
int32_t
ipc_recv(envid_t *from_env_store, void *pg, int *perm_store)
{
  800de0:	f3 0f 1e fb          	endbr32 
  800de4:	55                   	push   %ebp
  800de5:	89 e5                	mov    %esp,%ebp
  800de7:	56                   	push   %esi
  800de8:	53                   	push   %ebx
  800de9:	8b 75 08             	mov    0x8(%ebp),%esi
  800dec:	8b 45 0c             	mov    0xc(%ebp),%eax
  800def:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	int error;
	if(!pg)pg = (void *)UTOP; // 如果设置为UTOP，这个值其实可以比UTOP大，设置为这个值认为pg无效了，不会进行页面传递【共享页面的设置】，而是只进行值value的传递。
  800df2:	85 c0                	test   %eax,%eax
  800df4:	ba 00 00 c0 ee       	mov    $0xeec00000,%edx
  800df9:	0f 44 c2             	cmove  %edx,%eax
	if((error = sys_ipc_recv(pg)) < 0){
  800dfc:	83 ec 0c             	sub    $0xc,%esp
  800dff:	50                   	push   %eax
  800e00:	e8 96 ff ff ff       	call   800d9b <sys_ipc_recv>
  800e05:	83 c4 10             	add    $0x10,%esp
  800e08:	85 c0                	test   %eax,%eax
  800e0a:	78 3f                	js     800e4b <ipc_recv+0x6b>
		if(from_env_store)*from_env_store = 0;
		if(perm_store)*perm_store = 0;
		return error;
	}

	thisenv = &envs[ENVX(sys_getenvid())]; // for lab4's challenge sfork().
  800e0c:	e8 78 fd ff ff       	call   800b89 <sys_getenvid>
  800e11:	25 ff 03 00 00       	and    $0x3ff,%eax
  800e16:	6b d0 7c             	imul   $0x7c,%eax,%edx
  800e19:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  800e1f:	89 15 04 40 80 00    	mov    %edx,0x804004

	if(from_env_store)*from_env_store = thisenv->env_ipc_from;
  800e25:	85 f6                	test   %esi,%esi
  800e27:	74 05                	je     800e2e <ipc_recv+0x4e>
  800e29:	8b 42 74             	mov    0x74(%edx),%eax
  800e2c:	89 06                	mov    %eax,(%esi)
	if(perm_store)*perm_store = thisenv->env_ipc_perm;
  800e2e:	85 db                	test   %ebx,%ebx
  800e30:	74 0a                	je     800e3c <ipc_recv+0x5c>
  800e32:	a1 04 40 80 00       	mov    0x804004,%eax
  800e37:	8b 40 78             	mov    0x78(%eax),%eax
  800e3a:	89 03                	mov    %eax,(%ebx)
	return thisenv->env_ipc_value;
  800e3c:	a1 04 40 80 00       	mov    0x804004,%eax
  800e41:	8b 40 70             	mov    0x70(%eax),%eax
}
  800e44:	8d 65 f8             	lea    -0x8(%ebp),%esp
  800e47:	5b                   	pop    %ebx
  800e48:	5e                   	pop    %esi
  800e49:	5d                   	pop    %ebp
  800e4a:	c3                   	ret    
		if(from_env_store)*from_env_store = 0;
  800e4b:	85 f6                	test   %esi,%esi
  800e4d:	74 06                	je     800e55 <ipc_recv+0x75>
  800e4f:	c7 06 00 00 00 00    	movl   $0x0,(%esi)
		if(perm_store)*perm_store = 0;
  800e55:	85 db                	test   %ebx,%ebx
  800e57:	74 eb                	je     800e44 <ipc_recv+0x64>
  800e59:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  800e5f:	eb e3                	jmp    800e44 <ipc_recv+0x64>

00800e61 <ipc_send>:
//   Use sys_yield() to be CPU-friendly.
//   If 'pg' is null, pass sys_ipc_try_send a value that it will understand
//   as meaning "no page".  (Zero is not the right value.)
void
ipc_send(envid_t to_env, uint32_t val, void *pg, int perm)
{
  800e61:	f3 0f 1e fb          	endbr32 
  800e65:	55                   	push   %ebp
  800e66:	89 e5                	mov    %esp,%ebp
  800e68:	57                   	push   %edi
  800e69:	56                   	push   %esi
  800e6a:	53                   	push   %ebx
  800e6b:	83 ec 0c             	sub    $0xc,%esp
  800e6e:	8b 7d 08             	mov    0x8(%ebp),%edi
  800e71:	8b 75 0c             	mov    0xc(%ebp),%esi
  800e74:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	if(!pg)pg = (void *)UTOP; // 不会进行页面共享，只会sending message。
  800e77:	85 db                	test   %ebx,%ebx
  800e79:	b8 00 00 c0 ee       	mov    $0xeec00000,%eax
  800e7e:	0f 44 d8             	cmove  %eax,%ebx
	int error;
	// Keep trying until it succeeds.
	while((error = sys_ipc_try_send(to_env, val, pg, perm)) < 0){
  800e81:	ff 75 14             	pushl  0x14(%ebp)
  800e84:	53                   	push   %ebx
  800e85:	56                   	push   %esi
  800e86:	57                   	push   %edi
  800e87:	e8 e8 fe ff ff       	call   800d74 <sys_ipc_try_send>
  800e8c:	83 c4 10             	add    $0x10,%esp
  800e8f:	85 c0                	test   %eax,%eax
  800e91:	79 1e                	jns    800eb1 <ipc_send+0x50>
        //如果error是没有接收者，那么就会继续尝试send
		if(error != -E_IPC_NOT_RECV){
  800e93:	83 f8 f9             	cmp    $0xfffffff9,%eax
  800e96:	75 07                	jne    800e9f <ipc_send+0x3e>
			panic("sys_ipc_try_send:%e", error);
		}
        //但是不是一味的占用cpu，而是尝试一次就释放CPU，等待再次被调度，才会重新send，寻找receiver。
		sys_yield(); // To be CPU-friendly.
  800e98:	e8 0f fd ff ff       	call   800bac <sys_yield>
  800e9d:	eb e2                	jmp    800e81 <ipc_send+0x20>
			panic("sys_ipc_try_send:%e", error);
  800e9f:	50                   	push   %eax
  800ea0:	68 aa 22 80 00       	push   $0x8022aa
  800ea5:	6a 3b                	push   $0x3b
  800ea7:	68 be 22 80 00       	push   $0x8022be
  800eac:	e8 8a 0d 00 00       	call   801c3b <_panic>
	}
}
  800eb1:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800eb4:	5b                   	pop    %ebx
  800eb5:	5e                   	pop    %esi
  800eb6:	5f                   	pop    %edi
  800eb7:	5d                   	pop    %ebp
  800eb8:	c3                   	ret    

00800eb9 <ipc_find_env>:
// Find the first environment of the given type.  We'll use this to
// find special environments.
// Returns 0 if no such environment exists.
envid_t
ipc_find_env(enum EnvType type)
{
  800eb9:	f3 0f 1e fb          	endbr32 
  800ebd:	55                   	push   %ebp
  800ebe:	89 e5                	mov    %esp,%ebp
  800ec0:	8b 4d 08             	mov    0x8(%ebp),%ecx
	int i;
	for (i = 0; i < NENV; i++)
  800ec3:	b8 00 00 00 00       	mov    $0x0,%eax
		if (envs[i].env_type == type)
  800ec8:	6b d0 7c             	imul   $0x7c,%eax,%edx
  800ecb:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  800ed1:	8b 52 50             	mov    0x50(%edx),%edx
  800ed4:	39 ca                	cmp    %ecx,%edx
  800ed6:	74 11                	je     800ee9 <ipc_find_env+0x30>
	for (i = 0; i < NENV; i++)
  800ed8:	83 c0 01             	add    $0x1,%eax
  800edb:	3d 00 04 00 00       	cmp    $0x400,%eax
  800ee0:	75 e6                	jne    800ec8 <ipc_find_env+0xf>
			return envs[i].env_id;
	return 0;
  800ee2:	b8 00 00 00 00       	mov    $0x0,%eax
  800ee7:	eb 0b                	jmp    800ef4 <ipc_find_env+0x3b>
			return envs[i].env_id;
  800ee9:	6b c0 7c             	imul   $0x7c,%eax,%eax
  800eec:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  800ef1:	8b 40 48             	mov    0x48(%eax),%eax
}
  800ef4:	5d                   	pop    %ebp
  800ef5:	c3                   	ret    

00800ef6 <fd2num>:
// File descriptor manipulators
// --------------------------------------------------------------

int
fd2num(struct Fd *fd)
{
  800ef6:	f3 0f 1e fb          	endbr32 
  800efa:	55                   	push   %ebp
  800efb:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800efd:	8b 45 08             	mov    0x8(%ebp),%eax
  800f00:	05 00 00 00 30       	add    $0x30000000,%eax
  800f05:	c1 e8 0c             	shr    $0xc,%eax
}
  800f08:	5d                   	pop    %ebp
  800f09:	c3                   	ret    

00800f0a <fd2data>:

char*
fd2data(struct Fd *fd)
{
  800f0a:	f3 0f 1e fb          	endbr32 
  800f0e:	55                   	push   %ebp
  800f0f:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800f11:	8b 45 08             	mov    0x8(%ebp),%eax
  800f14:	05 00 00 00 30       	add    $0x30000000,%eax
	return INDEX2DATA(fd2num(fd));
  800f19:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  800f1e:	2d 00 00 fe 2f       	sub    $0x2ffe0000,%eax
}
  800f23:	5d                   	pop    %ebp
  800f24:	c3                   	ret    

00800f25 <fd_alloc>:
// Returns 0 on success, < 0 on error.  Errors are:
//	-E_MAX_FD: no more file descriptors
// On error, *fd_store is set to 0.
int
fd_alloc(struct Fd **fd_store)
{
  800f25:	f3 0f 1e fb          	endbr32 
  800f29:	55                   	push   %ebp
  800f2a:	89 e5                	mov    %esp,%ebp
  800f2c:	b8 00 00 00 d0       	mov    $0xd0000000,%eax
	int i;
	struct Fd *fd;

	for (i = 0; i < MAXFD; i++) {
		fd = INDEX2FD(i);
		if ((uvpd[PDX(fd)] & PTE_P) == 0 || (uvpt[PGNUM(fd)] & PTE_P) == 0) {
  800f31:	89 c2                	mov    %eax,%edx
  800f33:	c1 ea 16             	shr    $0x16,%edx
  800f36:	8b 14 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%edx
  800f3d:	f6 c2 01             	test   $0x1,%dl
  800f40:	74 2d                	je     800f6f <fd_alloc+0x4a>
  800f42:	89 c2                	mov    %eax,%edx
  800f44:	c1 ea 0c             	shr    $0xc,%edx
  800f47:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  800f4e:	f6 c2 01             	test   $0x1,%dl
  800f51:	74 1c                	je     800f6f <fd_alloc+0x4a>
  800f53:	05 00 10 00 00       	add    $0x1000,%eax
	for (i = 0; i < MAXFD; i++) {
  800f58:	3d 00 00 02 d0       	cmp    $0xd0020000,%eax
  800f5d:	75 d2                	jne    800f31 <fd_alloc+0xc>
			*fd_store = fd;
			return 0;
		}
	}
	*fd_store = 0;
  800f5f:	8b 45 08             	mov    0x8(%ebp),%eax
  800f62:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_MAX_OPEN;
  800f68:	b8 f6 ff ff ff       	mov    $0xfffffff6,%eax
  800f6d:	eb 0a                	jmp    800f79 <fd_alloc+0x54>
			*fd_store = fd;
  800f6f:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800f72:	89 01                	mov    %eax,(%ecx)
			return 0;
  800f74:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800f79:	5d                   	pop    %ebp
  800f7a:	c3                   	ret    

00800f7b <fd_lookup>:
// Returns 0 on success (the page is in range and mapped), < 0 on error.
// Errors are:
//	-E_INVAL: fdnum was either not in range or not mapped.
int
fd_lookup(int fdnum, struct Fd **fd_store)
{
  800f7b:	f3 0f 1e fb          	endbr32 
  800f7f:	55                   	push   %ebp
  800f80:	89 e5                	mov    %esp,%ebp
  800f82:	8b 45 08             	mov    0x8(%ebp),%eax
	struct Fd *fd;

	if (fdnum < 0 || fdnum >= MAXFD) {
  800f85:	83 f8 1f             	cmp    $0x1f,%eax
  800f88:	77 30                	ja     800fba <fd_lookup+0x3f>
		if (debug)
			cprintf("[%08x] bad fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	fd = INDEX2FD(fdnum);
  800f8a:	c1 e0 0c             	shl    $0xc,%eax
  800f8d:	2d 00 00 00 30       	sub    $0x30000000,%eax
	if (!(uvpd[PDX(fd)] & PTE_P) || !(uvpt[PGNUM(fd)] & PTE_P)) {
  800f92:	8b 15 00 dd 7b ef    	mov    0xef7bdd00,%edx
  800f98:	f6 c2 01             	test   $0x1,%dl
  800f9b:	74 24                	je     800fc1 <fd_lookup+0x46>
  800f9d:	89 c2                	mov    %eax,%edx
  800f9f:	c1 ea 0c             	shr    $0xc,%edx
  800fa2:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  800fa9:	f6 c2 01             	test   $0x1,%dl
  800fac:	74 1a                	je     800fc8 <fd_lookup+0x4d>
		if (debug)
			cprintf("[%08x] closed fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	*fd_store = fd;
  800fae:	8b 55 0c             	mov    0xc(%ebp),%edx
  800fb1:	89 02                	mov    %eax,(%edx)
	return 0;
  800fb3:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800fb8:	5d                   	pop    %ebp
  800fb9:	c3                   	ret    
		return -E_INVAL;
  800fba:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800fbf:	eb f7                	jmp    800fb8 <fd_lookup+0x3d>
		return -E_INVAL;
  800fc1:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800fc6:	eb f0                	jmp    800fb8 <fd_lookup+0x3d>
  800fc8:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800fcd:	eb e9                	jmp    800fb8 <fd_lookup+0x3d>

00800fcf <dev_lookup>:
	0
};

int
dev_lookup(int dev_id, struct Dev **dev)
{
  800fcf:	f3 0f 1e fb          	endbr32 
  800fd3:	55                   	push   %ebp
  800fd4:	89 e5                	mov    %esp,%ebp
  800fd6:	83 ec 08             	sub    $0x8,%esp
  800fd9:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800fdc:	ba 44 23 80 00       	mov    $0x802344,%edx
	int i;
	for (i = 0; devtab[i]; i++)
  800fe1:	b8 04 30 80 00       	mov    $0x803004,%eax
		if (devtab[i]->dev_id == dev_id) {
  800fe6:	39 08                	cmp    %ecx,(%eax)
  800fe8:	74 33                	je     80101d <dev_lookup+0x4e>
  800fea:	83 c2 04             	add    $0x4,%edx
	for (i = 0; devtab[i]; i++)
  800fed:	8b 02                	mov    (%edx),%eax
  800fef:	85 c0                	test   %eax,%eax
  800ff1:	75 f3                	jne    800fe6 <dev_lookup+0x17>
			*dev = devtab[i];
			return 0;
		}
	cprintf("[%08x] unknown device type %d\n", thisenv->env_id, dev_id);
  800ff3:	a1 04 40 80 00       	mov    0x804004,%eax
  800ff8:	8b 40 48             	mov    0x48(%eax),%eax
  800ffb:	83 ec 04             	sub    $0x4,%esp
  800ffe:	51                   	push   %ecx
  800fff:	50                   	push   %eax
  801000:	68 c8 22 80 00       	push   $0x8022c8
  801005:	e8 aa f1 ff ff       	call   8001b4 <cprintf>
	*dev = 0;
  80100a:	8b 45 0c             	mov    0xc(%ebp),%eax
  80100d:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_INVAL;
  801013:	83 c4 10             	add    $0x10,%esp
  801016:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
}
  80101b:	c9                   	leave  
  80101c:	c3                   	ret    
			*dev = devtab[i];
  80101d:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801020:	89 01                	mov    %eax,(%ecx)
			return 0;
  801022:	b8 00 00 00 00       	mov    $0x0,%eax
  801027:	eb f2                	jmp    80101b <dev_lookup+0x4c>

00801029 <fd_close>:
{
  801029:	f3 0f 1e fb          	endbr32 
  80102d:	55                   	push   %ebp
  80102e:	89 e5                	mov    %esp,%ebp
  801030:	57                   	push   %edi
  801031:	56                   	push   %esi
  801032:	53                   	push   %ebx
  801033:	83 ec 24             	sub    $0x24,%esp
  801036:	8b 75 08             	mov    0x8(%ebp),%esi
  801039:	8b 7d 0c             	mov    0xc(%ebp),%edi
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  80103c:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  80103f:	50                   	push   %eax
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  801040:	8d 86 00 00 00 30    	lea    0x30000000(%esi),%eax
  801046:	c1 e8 0c             	shr    $0xc,%eax
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  801049:	50                   	push   %eax
  80104a:	e8 2c ff ff ff       	call   800f7b <fd_lookup>
  80104f:	89 c3                	mov    %eax,%ebx
  801051:	83 c4 10             	add    $0x10,%esp
  801054:	85 c0                	test   %eax,%eax
  801056:	78 05                	js     80105d <fd_close+0x34>
	    || fd != fd2)
  801058:	39 75 e4             	cmp    %esi,-0x1c(%ebp)
  80105b:	74 16                	je     801073 <fd_close+0x4a>
		return (must_exist ? r : 0);
  80105d:	89 f8                	mov    %edi,%eax
  80105f:	84 c0                	test   %al,%al
  801061:	b8 00 00 00 00       	mov    $0x0,%eax
  801066:	0f 44 d8             	cmove  %eax,%ebx
}
  801069:	89 d8                	mov    %ebx,%eax
  80106b:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80106e:	5b                   	pop    %ebx
  80106f:	5e                   	pop    %esi
  801070:	5f                   	pop    %edi
  801071:	5d                   	pop    %ebp
  801072:	c3                   	ret    
	if ((r = dev_lookup(fd->fd_dev_id, &dev)) >= 0) {
  801073:	83 ec 08             	sub    $0x8,%esp
  801076:	8d 45 e0             	lea    -0x20(%ebp),%eax
  801079:	50                   	push   %eax
  80107a:	ff 36                	pushl  (%esi)
  80107c:	e8 4e ff ff ff       	call   800fcf <dev_lookup>
  801081:	89 c3                	mov    %eax,%ebx
  801083:	83 c4 10             	add    $0x10,%esp
  801086:	85 c0                	test   %eax,%eax
  801088:	78 1a                	js     8010a4 <fd_close+0x7b>
		if (dev->dev_close)
  80108a:	8b 45 e0             	mov    -0x20(%ebp),%eax
  80108d:	8b 40 10             	mov    0x10(%eax),%eax
			r = 0;
  801090:	bb 00 00 00 00       	mov    $0x0,%ebx
		if (dev->dev_close)
  801095:	85 c0                	test   %eax,%eax
  801097:	74 0b                	je     8010a4 <fd_close+0x7b>
			r = (*dev->dev_close)(fd);
  801099:	83 ec 0c             	sub    $0xc,%esp
  80109c:	56                   	push   %esi
  80109d:	ff d0                	call   *%eax
  80109f:	89 c3                	mov    %eax,%ebx
  8010a1:	83 c4 10             	add    $0x10,%esp
	(void) sys_page_unmap(0, fd);
  8010a4:	83 ec 08             	sub    $0x8,%esp
  8010a7:	56                   	push   %esi
  8010a8:	6a 00                	push   $0x0
  8010aa:	e8 ad fb ff ff       	call   800c5c <sys_page_unmap>
	return r;
  8010af:	83 c4 10             	add    $0x10,%esp
  8010b2:	eb b5                	jmp    801069 <fd_close+0x40>

008010b4 <close>:

int
close(int fdnum)
{
  8010b4:	f3 0f 1e fb          	endbr32 
  8010b8:	55                   	push   %ebp
  8010b9:	89 e5                	mov    %esp,%ebp
  8010bb:	83 ec 20             	sub    $0x20,%esp
	struct Fd *fd;
	int r;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  8010be:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8010c1:	50                   	push   %eax
  8010c2:	ff 75 08             	pushl  0x8(%ebp)
  8010c5:	e8 b1 fe ff ff       	call   800f7b <fd_lookup>
  8010ca:	83 c4 10             	add    $0x10,%esp
  8010cd:	85 c0                	test   %eax,%eax
  8010cf:	79 02                	jns    8010d3 <close+0x1f>
		return r;
	else
		return fd_close(fd, 1);
}
  8010d1:	c9                   	leave  
  8010d2:	c3                   	ret    
		return fd_close(fd, 1);
  8010d3:	83 ec 08             	sub    $0x8,%esp
  8010d6:	6a 01                	push   $0x1
  8010d8:	ff 75 f4             	pushl  -0xc(%ebp)
  8010db:	e8 49 ff ff ff       	call   801029 <fd_close>
  8010e0:	83 c4 10             	add    $0x10,%esp
  8010e3:	eb ec                	jmp    8010d1 <close+0x1d>

008010e5 <close_all>:

void
close_all(void)
{
  8010e5:	f3 0f 1e fb          	endbr32 
  8010e9:	55                   	push   %ebp
  8010ea:	89 e5                	mov    %esp,%ebp
  8010ec:	53                   	push   %ebx
  8010ed:	83 ec 04             	sub    $0x4,%esp
	int i;
	for (i = 0; i < MAXFD; i++)
  8010f0:	bb 00 00 00 00       	mov    $0x0,%ebx
		close(i);
  8010f5:	83 ec 0c             	sub    $0xc,%esp
  8010f8:	53                   	push   %ebx
  8010f9:	e8 b6 ff ff ff       	call   8010b4 <close>
	for (i = 0; i < MAXFD; i++)
  8010fe:	83 c3 01             	add    $0x1,%ebx
  801101:	83 c4 10             	add    $0x10,%esp
  801104:	83 fb 20             	cmp    $0x20,%ebx
  801107:	75 ec                	jne    8010f5 <close_all+0x10>
}
  801109:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80110c:	c9                   	leave  
  80110d:	c3                   	ret    

0080110e <dup>:
// file and the file offset of the other.
// Closes any previously open file descriptor at 'newfdnum'.
// This is implemented using virtual memory tricks (of course!).
int
dup(int oldfdnum, int newfdnum)
{
  80110e:	f3 0f 1e fb          	endbr32 
  801112:	55                   	push   %ebp
  801113:	89 e5                	mov    %esp,%ebp
  801115:	57                   	push   %edi
  801116:	56                   	push   %esi
  801117:	53                   	push   %ebx
  801118:	83 ec 24             	sub    $0x24,%esp
	int r;
	char *ova, *nva;
	pte_t pte;
	struct Fd *oldfd, *newfd;

	if ((r = fd_lookup(oldfdnum, &oldfd)) < 0)
  80111b:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  80111e:	50                   	push   %eax
  80111f:	ff 75 08             	pushl  0x8(%ebp)
  801122:	e8 54 fe ff ff       	call   800f7b <fd_lookup>
  801127:	89 c3                	mov    %eax,%ebx
  801129:	83 c4 10             	add    $0x10,%esp
  80112c:	85 c0                	test   %eax,%eax
  80112e:	0f 88 81 00 00 00    	js     8011b5 <dup+0xa7>
		return r;
	close(newfdnum);
  801134:	83 ec 0c             	sub    $0xc,%esp
  801137:	ff 75 0c             	pushl  0xc(%ebp)
  80113a:	e8 75 ff ff ff       	call   8010b4 <close>

	newfd = INDEX2FD(newfdnum);
  80113f:	8b 75 0c             	mov    0xc(%ebp),%esi
  801142:	c1 e6 0c             	shl    $0xc,%esi
  801145:	81 ee 00 00 00 30    	sub    $0x30000000,%esi
	ova = fd2data(oldfd);
  80114b:	83 c4 04             	add    $0x4,%esp
  80114e:	ff 75 e4             	pushl  -0x1c(%ebp)
  801151:	e8 b4 fd ff ff       	call   800f0a <fd2data>
  801156:	89 c3                	mov    %eax,%ebx
	nva = fd2data(newfd);
  801158:	89 34 24             	mov    %esi,(%esp)
  80115b:	e8 aa fd ff ff       	call   800f0a <fd2data>
  801160:	83 c4 10             	add    $0x10,%esp
  801163:	89 c7                	mov    %eax,%edi

	if ((uvpd[PDX(ova)] & PTE_P) && (uvpt[PGNUM(ova)] & PTE_P))
  801165:	89 d8                	mov    %ebx,%eax
  801167:	c1 e8 16             	shr    $0x16,%eax
  80116a:	8b 04 85 00 d0 7b ef 	mov    -0x10843000(,%eax,4),%eax
  801171:	a8 01                	test   $0x1,%al
  801173:	74 11                	je     801186 <dup+0x78>
  801175:	89 d8                	mov    %ebx,%eax
  801177:	c1 e8 0c             	shr    $0xc,%eax
  80117a:	8b 14 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%edx
  801181:	f6 c2 01             	test   $0x1,%dl
  801184:	75 39                	jne    8011bf <dup+0xb1>
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
			goto err;
	if ((r = sys_page_map(0, oldfd, 0, newfd, uvpt[PGNUM(oldfd)] & PTE_SYSCALL)) < 0)
  801186:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  801189:	89 d0                	mov    %edx,%eax
  80118b:	c1 e8 0c             	shr    $0xc,%eax
  80118e:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  801195:	83 ec 0c             	sub    $0xc,%esp
  801198:	25 07 0e 00 00       	and    $0xe07,%eax
  80119d:	50                   	push   %eax
  80119e:	56                   	push   %esi
  80119f:	6a 00                	push   $0x0
  8011a1:	52                   	push   %edx
  8011a2:	6a 00                	push   $0x0
  8011a4:	e8 6d fa ff ff       	call   800c16 <sys_page_map>
  8011a9:	89 c3                	mov    %eax,%ebx
  8011ab:	83 c4 20             	add    $0x20,%esp
  8011ae:	85 c0                	test   %eax,%eax
  8011b0:	78 31                	js     8011e3 <dup+0xd5>
		goto err;

	return newfdnum;
  8011b2:	8b 5d 0c             	mov    0xc(%ebp),%ebx

err:
	sys_page_unmap(0, newfd);
	sys_page_unmap(0, nva);
	return r;
}
  8011b5:	89 d8                	mov    %ebx,%eax
  8011b7:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8011ba:	5b                   	pop    %ebx
  8011bb:	5e                   	pop    %esi
  8011bc:	5f                   	pop    %edi
  8011bd:	5d                   	pop    %ebp
  8011be:	c3                   	ret    
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
  8011bf:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  8011c6:	83 ec 0c             	sub    $0xc,%esp
  8011c9:	25 07 0e 00 00       	and    $0xe07,%eax
  8011ce:	50                   	push   %eax
  8011cf:	57                   	push   %edi
  8011d0:	6a 00                	push   $0x0
  8011d2:	53                   	push   %ebx
  8011d3:	6a 00                	push   $0x0
  8011d5:	e8 3c fa ff ff       	call   800c16 <sys_page_map>
  8011da:	89 c3                	mov    %eax,%ebx
  8011dc:	83 c4 20             	add    $0x20,%esp
  8011df:	85 c0                	test   %eax,%eax
  8011e1:	79 a3                	jns    801186 <dup+0x78>
	sys_page_unmap(0, newfd);
  8011e3:	83 ec 08             	sub    $0x8,%esp
  8011e6:	56                   	push   %esi
  8011e7:	6a 00                	push   $0x0
  8011e9:	e8 6e fa ff ff       	call   800c5c <sys_page_unmap>
	sys_page_unmap(0, nva);
  8011ee:	83 c4 08             	add    $0x8,%esp
  8011f1:	57                   	push   %edi
  8011f2:	6a 00                	push   $0x0
  8011f4:	e8 63 fa ff ff       	call   800c5c <sys_page_unmap>
	return r;
  8011f9:	83 c4 10             	add    $0x10,%esp
  8011fc:	eb b7                	jmp    8011b5 <dup+0xa7>

008011fe <read>:

ssize_t
read(int fdnum, void *buf, size_t n)
{
  8011fe:	f3 0f 1e fb          	endbr32 
  801202:	55                   	push   %ebp
  801203:	89 e5                	mov    %esp,%ebp
  801205:	53                   	push   %ebx
  801206:	83 ec 1c             	sub    $0x1c,%esp
  801209:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  80120c:	8d 45 f0             	lea    -0x10(%ebp),%eax
  80120f:	50                   	push   %eax
  801210:	53                   	push   %ebx
  801211:	e8 65 fd ff ff       	call   800f7b <fd_lookup>
  801216:	83 c4 10             	add    $0x10,%esp
  801219:	85 c0                	test   %eax,%eax
  80121b:	78 3f                	js     80125c <read+0x5e>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  80121d:	83 ec 08             	sub    $0x8,%esp
  801220:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801223:	50                   	push   %eax
  801224:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801227:	ff 30                	pushl  (%eax)
  801229:	e8 a1 fd ff ff       	call   800fcf <dev_lookup>
  80122e:	83 c4 10             	add    $0x10,%esp
  801231:	85 c0                	test   %eax,%eax
  801233:	78 27                	js     80125c <read+0x5e>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_WRONLY) {
  801235:	8b 55 f0             	mov    -0x10(%ebp),%edx
  801238:	8b 42 08             	mov    0x8(%edx),%eax
  80123b:	83 e0 03             	and    $0x3,%eax
  80123e:	83 f8 01             	cmp    $0x1,%eax
  801241:	74 1e                	je     801261 <read+0x63>
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_read)
  801243:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801246:	8b 40 08             	mov    0x8(%eax),%eax
  801249:	85 c0                	test   %eax,%eax
  80124b:	74 35                	je     801282 <read+0x84>
		return -E_NOT_SUPP;
	return (*dev->dev_read)(fd, buf, n);
  80124d:	83 ec 04             	sub    $0x4,%esp
  801250:	ff 75 10             	pushl  0x10(%ebp)
  801253:	ff 75 0c             	pushl  0xc(%ebp)
  801256:	52                   	push   %edx
  801257:	ff d0                	call   *%eax
  801259:	83 c4 10             	add    $0x10,%esp
}
  80125c:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80125f:	c9                   	leave  
  801260:	c3                   	ret    
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
  801261:	a1 04 40 80 00       	mov    0x804004,%eax
  801266:	8b 40 48             	mov    0x48(%eax),%eax
  801269:	83 ec 04             	sub    $0x4,%esp
  80126c:	53                   	push   %ebx
  80126d:	50                   	push   %eax
  80126e:	68 09 23 80 00       	push   $0x802309
  801273:	e8 3c ef ff ff       	call   8001b4 <cprintf>
		return -E_INVAL;
  801278:	83 c4 10             	add    $0x10,%esp
  80127b:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801280:	eb da                	jmp    80125c <read+0x5e>
		return -E_NOT_SUPP;
  801282:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  801287:	eb d3                	jmp    80125c <read+0x5e>

00801289 <readn>:

ssize_t
readn(int fdnum, void *buf, size_t n)
{
  801289:	f3 0f 1e fb          	endbr32 
  80128d:	55                   	push   %ebp
  80128e:	89 e5                	mov    %esp,%ebp
  801290:	57                   	push   %edi
  801291:	56                   	push   %esi
  801292:	53                   	push   %ebx
  801293:	83 ec 0c             	sub    $0xc,%esp
  801296:	8b 7d 08             	mov    0x8(%ebp),%edi
  801299:	8b 75 10             	mov    0x10(%ebp),%esi
	int m, tot;

	for (tot = 0; tot < n; tot += m) {
  80129c:	bb 00 00 00 00       	mov    $0x0,%ebx
  8012a1:	eb 02                	jmp    8012a5 <readn+0x1c>
  8012a3:	01 c3                	add    %eax,%ebx
  8012a5:	39 f3                	cmp    %esi,%ebx
  8012a7:	73 21                	jae    8012ca <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  8012a9:	83 ec 04             	sub    $0x4,%esp
  8012ac:	89 f0                	mov    %esi,%eax
  8012ae:	29 d8                	sub    %ebx,%eax
  8012b0:	50                   	push   %eax
  8012b1:	89 d8                	mov    %ebx,%eax
  8012b3:	03 45 0c             	add    0xc(%ebp),%eax
  8012b6:	50                   	push   %eax
  8012b7:	57                   	push   %edi
  8012b8:	e8 41 ff ff ff       	call   8011fe <read>
		if (m < 0)
  8012bd:	83 c4 10             	add    $0x10,%esp
  8012c0:	85 c0                	test   %eax,%eax
  8012c2:	78 04                	js     8012c8 <readn+0x3f>
			return m;
		if (m == 0)
  8012c4:	75 dd                	jne    8012a3 <readn+0x1a>
  8012c6:	eb 02                	jmp    8012ca <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  8012c8:	89 c3                	mov    %eax,%ebx
			break;
	}
	return tot;
}
  8012ca:	89 d8                	mov    %ebx,%eax
  8012cc:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8012cf:	5b                   	pop    %ebx
  8012d0:	5e                   	pop    %esi
  8012d1:	5f                   	pop    %edi
  8012d2:	5d                   	pop    %ebp
  8012d3:	c3                   	ret    

008012d4 <write>:

ssize_t
write(int fdnum, const void *buf, size_t n)
{
  8012d4:	f3 0f 1e fb          	endbr32 
  8012d8:	55                   	push   %ebp
  8012d9:	89 e5                	mov    %esp,%ebp
  8012db:	53                   	push   %ebx
  8012dc:	83 ec 1c             	sub    $0x1c,%esp
  8012df:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8012e2:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8012e5:	50                   	push   %eax
  8012e6:	53                   	push   %ebx
  8012e7:	e8 8f fc ff ff       	call   800f7b <fd_lookup>
  8012ec:	83 c4 10             	add    $0x10,%esp
  8012ef:	85 c0                	test   %eax,%eax
  8012f1:	78 3a                	js     80132d <write+0x59>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8012f3:	83 ec 08             	sub    $0x8,%esp
  8012f6:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8012f9:	50                   	push   %eax
  8012fa:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8012fd:	ff 30                	pushl  (%eax)
  8012ff:	e8 cb fc ff ff       	call   800fcf <dev_lookup>
  801304:	83 c4 10             	add    $0x10,%esp
  801307:	85 c0                	test   %eax,%eax
  801309:	78 22                	js     80132d <write+0x59>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  80130b:	8b 45 f0             	mov    -0x10(%ebp),%eax
  80130e:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  801312:	74 1e                	je     801332 <write+0x5e>
		return -E_INVAL;
	}
	if (debug)
		cprintf("write %d %p %d via dev %s\n",
			fdnum, buf, n, dev->dev_name);
	if (!dev->dev_write)
  801314:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801317:	8b 52 0c             	mov    0xc(%edx),%edx
  80131a:	85 d2                	test   %edx,%edx
  80131c:	74 35                	je     801353 <write+0x7f>
		return -E_NOT_SUPP;
	return (*dev->dev_write)(fd, buf, n);
  80131e:	83 ec 04             	sub    $0x4,%esp
  801321:	ff 75 10             	pushl  0x10(%ebp)
  801324:	ff 75 0c             	pushl  0xc(%ebp)
  801327:	50                   	push   %eax
  801328:	ff d2                	call   *%edx
  80132a:	83 c4 10             	add    $0x10,%esp
}
  80132d:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801330:	c9                   	leave  
  801331:	c3                   	ret    
		cprintf("[%08x] write %d -- bad mode\n", thisenv->env_id, fdnum);
  801332:	a1 04 40 80 00       	mov    0x804004,%eax
  801337:	8b 40 48             	mov    0x48(%eax),%eax
  80133a:	83 ec 04             	sub    $0x4,%esp
  80133d:	53                   	push   %ebx
  80133e:	50                   	push   %eax
  80133f:	68 25 23 80 00       	push   $0x802325
  801344:	e8 6b ee ff ff       	call   8001b4 <cprintf>
		return -E_INVAL;
  801349:	83 c4 10             	add    $0x10,%esp
  80134c:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801351:	eb da                	jmp    80132d <write+0x59>
		return -E_NOT_SUPP;
  801353:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  801358:	eb d3                	jmp    80132d <write+0x59>

0080135a <seek>:

int
seek(int fdnum, off_t offset)
{
  80135a:	f3 0f 1e fb          	endbr32 
  80135e:	55                   	push   %ebp
  80135f:	89 e5                	mov    %esp,%ebp
  801361:	83 ec 20             	sub    $0x20,%esp
	int r;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801364:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801367:	50                   	push   %eax
  801368:	ff 75 08             	pushl  0x8(%ebp)
  80136b:	e8 0b fc ff ff       	call   800f7b <fd_lookup>
  801370:	83 c4 10             	add    $0x10,%esp
  801373:	85 c0                	test   %eax,%eax
  801375:	78 0e                	js     801385 <seek+0x2b>
		return r;
	fd->fd_offset = offset;
  801377:	8b 55 0c             	mov    0xc(%ebp),%edx
  80137a:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80137d:	89 50 04             	mov    %edx,0x4(%eax)
	return 0;
  801380:	b8 00 00 00 00       	mov    $0x0,%eax
}
  801385:	c9                   	leave  
  801386:	c3                   	ret    

00801387 <ftruncate>:

int
ftruncate(int fdnum, off_t newsize)
{
  801387:	f3 0f 1e fb          	endbr32 
  80138b:	55                   	push   %ebp
  80138c:	89 e5                	mov    %esp,%ebp
  80138e:	53                   	push   %ebx
  80138f:	83 ec 1c             	sub    $0x1c,%esp
  801392:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;
	if ((r = fd_lookup(fdnum, &fd)) < 0
  801395:	8d 45 f0             	lea    -0x10(%ebp),%eax
  801398:	50                   	push   %eax
  801399:	53                   	push   %ebx
  80139a:	e8 dc fb ff ff       	call   800f7b <fd_lookup>
  80139f:	83 c4 10             	add    $0x10,%esp
  8013a2:	85 c0                	test   %eax,%eax
  8013a4:	78 37                	js     8013dd <ftruncate+0x56>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8013a6:	83 ec 08             	sub    $0x8,%esp
  8013a9:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8013ac:	50                   	push   %eax
  8013ad:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8013b0:	ff 30                	pushl  (%eax)
  8013b2:	e8 18 fc ff ff       	call   800fcf <dev_lookup>
  8013b7:	83 c4 10             	add    $0x10,%esp
  8013ba:	85 c0                	test   %eax,%eax
  8013bc:	78 1f                	js     8013dd <ftruncate+0x56>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  8013be:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8013c1:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  8013c5:	74 1b                	je     8013e2 <ftruncate+0x5b>
		cprintf("[%08x] ftruncate %d -- bad mode\n",
			thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_trunc)
  8013c7:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8013ca:	8b 52 18             	mov    0x18(%edx),%edx
  8013cd:	85 d2                	test   %edx,%edx
  8013cf:	74 32                	je     801403 <ftruncate+0x7c>
		return -E_NOT_SUPP;
	return (*dev->dev_trunc)(fd, newsize);
  8013d1:	83 ec 08             	sub    $0x8,%esp
  8013d4:	ff 75 0c             	pushl  0xc(%ebp)
  8013d7:	50                   	push   %eax
  8013d8:	ff d2                	call   *%edx
  8013da:	83 c4 10             	add    $0x10,%esp
}
  8013dd:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8013e0:	c9                   	leave  
  8013e1:	c3                   	ret    
			thisenv->env_id, fdnum);
  8013e2:	a1 04 40 80 00       	mov    0x804004,%eax
		cprintf("[%08x] ftruncate %d -- bad mode\n",
  8013e7:	8b 40 48             	mov    0x48(%eax),%eax
  8013ea:	83 ec 04             	sub    $0x4,%esp
  8013ed:	53                   	push   %ebx
  8013ee:	50                   	push   %eax
  8013ef:	68 e8 22 80 00       	push   $0x8022e8
  8013f4:	e8 bb ed ff ff       	call   8001b4 <cprintf>
		return -E_INVAL;
  8013f9:	83 c4 10             	add    $0x10,%esp
  8013fc:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801401:	eb da                	jmp    8013dd <ftruncate+0x56>
		return -E_NOT_SUPP;
  801403:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  801408:	eb d3                	jmp    8013dd <ftruncate+0x56>

0080140a <fstat>:

int
fstat(int fdnum, struct Stat *stat)
{
  80140a:	f3 0f 1e fb          	endbr32 
  80140e:	55                   	push   %ebp
  80140f:	89 e5                	mov    %esp,%ebp
  801411:	53                   	push   %ebx
  801412:	83 ec 1c             	sub    $0x1c,%esp
  801415:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  801418:	8d 45 f0             	lea    -0x10(%ebp),%eax
  80141b:	50                   	push   %eax
  80141c:	ff 75 08             	pushl  0x8(%ebp)
  80141f:	e8 57 fb ff ff       	call   800f7b <fd_lookup>
  801424:	83 c4 10             	add    $0x10,%esp
  801427:	85 c0                	test   %eax,%eax
  801429:	78 4b                	js     801476 <fstat+0x6c>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  80142b:	83 ec 08             	sub    $0x8,%esp
  80142e:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801431:	50                   	push   %eax
  801432:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801435:	ff 30                	pushl  (%eax)
  801437:	e8 93 fb ff ff       	call   800fcf <dev_lookup>
  80143c:	83 c4 10             	add    $0x10,%esp
  80143f:	85 c0                	test   %eax,%eax
  801441:	78 33                	js     801476 <fstat+0x6c>
		return r;
	if (!dev->dev_stat)
  801443:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801446:	83 78 14 00          	cmpl   $0x0,0x14(%eax)
  80144a:	74 2f                	je     80147b <fstat+0x71>
		return -E_NOT_SUPP;
	stat->st_name[0] = 0;
  80144c:	c6 03 00             	movb   $0x0,(%ebx)
	stat->st_size = 0;
  80144f:	c7 83 80 00 00 00 00 	movl   $0x0,0x80(%ebx)
  801456:	00 00 00 
	stat->st_isdir = 0;
  801459:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  801460:	00 00 00 
	stat->st_dev = dev;
  801463:	89 83 88 00 00 00    	mov    %eax,0x88(%ebx)
	return (*dev->dev_stat)(fd, stat);
  801469:	83 ec 08             	sub    $0x8,%esp
  80146c:	53                   	push   %ebx
  80146d:	ff 75 f0             	pushl  -0x10(%ebp)
  801470:	ff 50 14             	call   *0x14(%eax)
  801473:	83 c4 10             	add    $0x10,%esp
}
  801476:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801479:	c9                   	leave  
  80147a:	c3                   	ret    
		return -E_NOT_SUPP;
  80147b:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  801480:	eb f4                	jmp    801476 <fstat+0x6c>

00801482 <stat>:

int
stat(const char *path, struct Stat *stat)
{
  801482:	f3 0f 1e fb          	endbr32 
  801486:	55                   	push   %ebp
  801487:	89 e5                	mov    %esp,%ebp
  801489:	56                   	push   %esi
  80148a:	53                   	push   %ebx
	int fd, r;

	if ((fd = open(path, O_RDONLY)) < 0)
  80148b:	83 ec 08             	sub    $0x8,%esp
  80148e:	6a 00                	push   $0x0
  801490:	ff 75 08             	pushl  0x8(%ebp)
  801493:	e8 fb 01 00 00       	call   801693 <open>
  801498:	89 c3                	mov    %eax,%ebx
  80149a:	83 c4 10             	add    $0x10,%esp
  80149d:	85 c0                	test   %eax,%eax
  80149f:	78 1b                	js     8014bc <stat+0x3a>
		return fd;
	r = fstat(fd, stat);
  8014a1:	83 ec 08             	sub    $0x8,%esp
  8014a4:	ff 75 0c             	pushl  0xc(%ebp)
  8014a7:	50                   	push   %eax
  8014a8:	e8 5d ff ff ff       	call   80140a <fstat>
  8014ad:	89 c6                	mov    %eax,%esi
	close(fd);
  8014af:	89 1c 24             	mov    %ebx,(%esp)
  8014b2:	e8 fd fb ff ff       	call   8010b4 <close>
	return r;
  8014b7:	83 c4 10             	add    $0x10,%esp
  8014ba:	89 f3                	mov    %esi,%ebx
}
  8014bc:	89 d8                	mov    %ebx,%eax
  8014be:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8014c1:	5b                   	pop    %ebx
  8014c2:	5e                   	pop    %esi
  8014c3:	5d                   	pop    %ebp
  8014c4:	c3                   	ret    

008014c5 <fsipc>:
// type: request code, passed as the simple integer IPC value.
// dstva: virtual address at which to receive reply page, 0 if none.
// Returns result from the file server.
static int
fsipc(unsigned type, void *dstva)
{
  8014c5:	55                   	push   %ebp
  8014c6:	89 e5                	mov    %esp,%ebp
  8014c8:	56                   	push   %esi
  8014c9:	53                   	push   %ebx
  8014ca:	89 c6                	mov    %eax,%esi
  8014cc:	89 d3                	mov    %edx,%ebx
	static envid_t fsenv;
	if (fsenv == 0)
  8014ce:	83 3d 00 40 80 00 00 	cmpl   $0x0,0x804000
  8014d5:	74 27                	je     8014fe <fsipc+0x39>
	static_assert(sizeof(fsipcbuf) == PGSIZE);

	if (debug)
		cprintf("[%08x] fsipc %d %08x\n", thisenv->env_id, type, *(uint32_t *)&fsipcbuf);

	ipc_send(fsenv, type, &fsipcbuf, PTE_P | PTE_W | PTE_U);
  8014d7:	6a 07                	push   $0x7
  8014d9:	68 00 50 80 00       	push   $0x805000
  8014de:	56                   	push   %esi
  8014df:	ff 35 00 40 80 00    	pushl  0x804000
  8014e5:	e8 77 f9 ff ff       	call   800e61 <ipc_send>
	return ipc_recv(NULL, dstva, NULL);
  8014ea:	83 c4 0c             	add    $0xc,%esp
  8014ed:	6a 00                	push   $0x0
  8014ef:	53                   	push   %ebx
  8014f0:	6a 00                	push   $0x0
  8014f2:	e8 e9 f8 ff ff       	call   800de0 <ipc_recv>
}
  8014f7:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8014fa:	5b                   	pop    %ebx
  8014fb:	5e                   	pop    %esi
  8014fc:	5d                   	pop    %ebp
  8014fd:	c3                   	ret    
		fsenv = ipc_find_env(ENV_TYPE_FS);
  8014fe:	83 ec 0c             	sub    $0xc,%esp
  801501:	6a 01                	push   $0x1
  801503:	e8 b1 f9 ff ff       	call   800eb9 <ipc_find_env>
  801508:	a3 00 40 80 00       	mov    %eax,0x804000
  80150d:	83 c4 10             	add    $0x10,%esp
  801510:	eb c5                	jmp    8014d7 <fsipc+0x12>

00801512 <devfile_trunc>:
}

// Truncate or extend an open file to 'size' bytes
static int
devfile_trunc(struct Fd *fd, off_t newsize)
{
  801512:	f3 0f 1e fb          	endbr32 
  801516:	55                   	push   %ebp
  801517:	89 e5                	mov    %esp,%ebp
  801519:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.set_size.req_fileid = fd->fd_file.id;
  80151c:	8b 45 08             	mov    0x8(%ebp),%eax
  80151f:	8b 40 0c             	mov    0xc(%eax),%eax
  801522:	a3 00 50 80 00       	mov    %eax,0x805000
	fsipcbuf.set_size.req_size = newsize;
  801527:	8b 45 0c             	mov    0xc(%ebp),%eax
  80152a:	a3 04 50 80 00       	mov    %eax,0x805004
	return fsipc(FSREQ_SET_SIZE, NULL);
  80152f:	ba 00 00 00 00       	mov    $0x0,%edx
  801534:	b8 02 00 00 00       	mov    $0x2,%eax
  801539:	e8 87 ff ff ff       	call   8014c5 <fsipc>
}
  80153e:	c9                   	leave  
  80153f:	c3                   	ret    

00801540 <devfile_flush>:
{
  801540:	f3 0f 1e fb          	endbr32 
  801544:	55                   	push   %ebp
  801545:	89 e5                	mov    %esp,%ebp
  801547:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.flush.req_fileid = fd->fd_file.id;
  80154a:	8b 45 08             	mov    0x8(%ebp),%eax
  80154d:	8b 40 0c             	mov    0xc(%eax),%eax
  801550:	a3 00 50 80 00       	mov    %eax,0x805000
	return fsipc(FSREQ_FLUSH, NULL);
  801555:	ba 00 00 00 00       	mov    $0x0,%edx
  80155a:	b8 06 00 00 00       	mov    $0x6,%eax
  80155f:	e8 61 ff ff ff       	call   8014c5 <fsipc>
}
  801564:	c9                   	leave  
  801565:	c3                   	ret    

00801566 <devfile_stat>:
{
  801566:	f3 0f 1e fb          	endbr32 
  80156a:	55                   	push   %ebp
  80156b:	89 e5                	mov    %esp,%ebp
  80156d:	53                   	push   %ebx
  80156e:	83 ec 04             	sub    $0x4,%esp
  801571:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	fsipcbuf.stat.req_fileid = fd->fd_file.id;
  801574:	8b 45 08             	mov    0x8(%ebp),%eax
  801577:	8b 40 0c             	mov    0xc(%eax),%eax
  80157a:	a3 00 50 80 00       	mov    %eax,0x805000
	if ((r = fsipc(FSREQ_STAT, NULL)) < 0)
  80157f:	ba 00 00 00 00       	mov    $0x0,%edx
  801584:	b8 05 00 00 00       	mov    $0x5,%eax
  801589:	e8 37 ff ff ff       	call   8014c5 <fsipc>
  80158e:	85 c0                	test   %eax,%eax
  801590:	78 2c                	js     8015be <devfile_stat+0x58>
	strcpy(st->st_name, fsipcbuf.statRet.ret_name);
  801592:	83 ec 08             	sub    $0x8,%esp
  801595:	68 00 50 80 00       	push   $0x805000
  80159a:	53                   	push   %ebx
  80159b:	e8 ed f1 ff ff       	call   80078d <strcpy>
	st->st_size = fsipcbuf.statRet.ret_size;
  8015a0:	a1 80 50 80 00       	mov    0x805080,%eax
  8015a5:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	st->st_isdir = fsipcbuf.statRet.ret_isdir;
  8015ab:	a1 84 50 80 00       	mov    0x805084,%eax
  8015b0:	89 83 84 00 00 00    	mov    %eax,0x84(%ebx)
	return 0;
  8015b6:	83 c4 10             	add    $0x10,%esp
  8015b9:	b8 00 00 00 00       	mov    $0x0,%eax
}
  8015be:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8015c1:	c9                   	leave  
  8015c2:	c3                   	ret    

008015c3 <devfile_write>:
{
  8015c3:	f3 0f 1e fb          	endbr32 
  8015c7:	55                   	push   %ebp
  8015c8:	89 e5                	mov    %esp,%ebp
  8015ca:	83 ec 0c             	sub    $0xc,%esp
  8015cd:	8b 45 10             	mov    0x10(%ebp),%eax
  8015d0:	3d f8 0f 00 00       	cmp    $0xff8,%eax
  8015d5:	ba f8 0f 00 00       	mov    $0xff8,%edx
  8015da:	0f 47 c2             	cmova  %edx,%eax
	fsipcbuf.write.req_fileid = fd->fd_file.id;
  8015dd:	8b 55 08             	mov    0x8(%ebp),%edx
  8015e0:	8b 52 0c             	mov    0xc(%edx),%edx
  8015e3:	89 15 00 50 80 00    	mov    %edx,0x805000
	fsipcbuf.write.req_n = n;
  8015e9:	a3 04 50 80 00       	mov    %eax,0x805004
	memmove(fsipcbuf.write.req_buf, buf, n);
  8015ee:	50                   	push   %eax
  8015ef:	ff 75 0c             	pushl  0xc(%ebp)
  8015f2:	68 08 50 80 00       	push   $0x805008
  8015f7:	e8 47 f3 ff ff       	call   800943 <memmove>
	return fsipc(FSREQ_WRITE, NULL);}
  8015fc:	ba 00 00 00 00       	mov    $0x0,%edx
  801601:	b8 04 00 00 00       	mov    $0x4,%eax
  801606:	e8 ba fe ff ff       	call   8014c5 <fsipc>
  80160b:	c9                   	leave  
  80160c:	c3                   	ret    

0080160d <devfile_read>:
{
  80160d:	f3 0f 1e fb          	endbr32 
  801611:	55                   	push   %ebp
  801612:	89 e5                	mov    %esp,%ebp
  801614:	56                   	push   %esi
  801615:	53                   	push   %ebx
  801616:	8b 75 10             	mov    0x10(%ebp),%esi
	fsipcbuf.read.req_fileid = fd->fd_file.id;
  801619:	8b 45 08             	mov    0x8(%ebp),%eax
  80161c:	8b 40 0c             	mov    0xc(%eax),%eax
  80161f:	a3 00 50 80 00       	mov    %eax,0x805000
	fsipcbuf.read.req_n = n;
  801624:	89 35 04 50 80 00    	mov    %esi,0x805004
	if ((r = fsipc(FSREQ_READ, NULL)) < 0)
  80162a:	ba 00 00 00 00       	mov    $0x0,%edx
  80162f:	b8 03 00 00 00       	mov    $0x3,%eax
  801634:	e8 8c fe ff ff       	call   8014c5 <fsipc>
  801639:	89 c3                	mov    %eax,%ebx
  80163b:	85 c0                	test   %eax,%eax
  80163d:	78 1f                	js     80165e <devfile_read+0x51>
	assert(r <= n);
  80163f:	39 f0                	cmp    %esi,%eax
  801641:	77 24                	ja     801667 <devfile_read+0x5a>
	assert(r <= PGSIZE);
  801643:	3d 00 10 00 00       	cmp    $0x1000,%eax
  801648:	7f 33                	jg     80167d <devfile_read+0x70>
	memmove(buf, fsipcbuf.readRet.ret_buf, r);
  80164a:	83 ec 04             	sub    $0x4,%esp
  80164d:	50                   	push   %eax
  80164e:	68 00 50 80 00       	push   $0x805000
  801653:	ff 75 0c             	pushl  0xc(%ebp)
  801656:	e8 e8 f2 ff ff       	call   800943 <memmove>
	return r;
  80165b:	83 c4 10             	add    $0x10,%esp
}
  80165e:	89 d8                	mov    %ebx,%eax
  801660:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801663:	5b                   	pop    %ebx
  801664:	5e                   	pop    %esi
  801665:	5d                   	pop    %ebp
  801666:	c3                   	ret    
	assert(r <= n);
  801667:	68 54 23 80 00       	push   $0x802354
  80166c:	68 5b 23 80 00       	push   $0x80235b
  801671:	6a 7c                	push   $0x7c
  801673:	68 70 23 80 00       	push   $0x802370
  801678:	e8 be 05 00 00       	call   801c3b <_panic>
	assert(r <= PGSIZE);
  80167d:	68 7b 23 80 00       	push   $0x80237b
  801682:	68 5b 23 80 00       	push   $0x80235b
  801687:	6a 7d                	push   $0x7d
  801689:	68 70 23 80 00       	push   $0x802370
  80168e:	e8 a8 05 00 00       	call   801c3b <_panic>

00801693 <open>:
{
  801693:	f3 0f 1e fb          	endbr32 
  801697:	55                   	push   %ebp
  801698:	89 e5                	mov    %esp,%ebp
  80169a:	56                   	push   %esi
  80169b:	53                   	push   %ebx
  80169c:	83 ec 1c             	sub    $0x1c,%esp
  80169f:	8b 75 08             	mov    0x8(%ebp),%esi
	if (strlen(path) >= MAXPATHLEN)
  8016a2:	56                   	push   %esi
  8016a3:	e8 a2 f0 ff ff       	call   80074a <strlen>
  8016a8:	83 c4 10             	add    $0x10,%esp
  8016ab:	3d ff 03 00 00       	cmp    $0x3ff,%eax
  8016b0:	7f 6c                	jg     80171e <open+0x8b>
	if ((r = fd_alloc(&fd)) < 0)
  8016b2:	83 ec 0c             	sub    $0xc,%esp
  8016b5:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8016b8:	50                   	push   %eax
  8016b9:	e8 67 f8 ff ff       	call   800f25 <fd_alloc>
  8016be:	89 c3                	mov    %eax,%ebx
  8016c0:	83 c4 10             	add    $0x10,%esp
  8016c3:	85 c0                	test   %eax,%eax
  8016c5:	78 3c                	js     801703 <open+0x70>
	strcpy(fsipcbuf.open.req_path, path);
  8016c7:	83 ec 08             	sub    $0x8,%esp
  8016ca:	56                   	push   %esi
  8016cb:	68 00 50 80 00       	push   $0x805000
  8016d0:	e8 b8 f0 ff ff       	call   80078d <strcpy>
	fsipcbuf.open.req_omode = mode;
  8016d5:	8b 45 0c             	mov    0xc(%ebp),%eax
  8016d8:	a3 00 54 80 00       	mov    %eax,0x805400
	if ((r = fsipc(FSREQ_OPEN, fd)) < 0) {
  8016dd:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8016e0:	b8 01 00 00 00       	mov    $0x1,%eax
  8016e5:	e8 db fd ff ff       	call   8014c5 <fsipc>
  8016ea:	89 c3                	mov    %eax,%ebx
  8016ec:	83 c4 10             	add    $0x10,%esp
  8016ef:	85 c0                	test   %eax,%eax
  8016f1:	78 19                	js     80170c <open+0x79>
	return fd2num(fd);
  8016f3:	83 ec 0c             	sub    $0xc,%esp
  8016f6:	ff 75 f4             	pushl  -0xc(%ebp)
  8016f9:	e8 f8 f7 ff ff       	call   800ef6 <fd2num>
  8016fe:	89 c3                	mov    %eax,%ebx
  801700:	83 c4 10             	add    $0x10,%esp
}
  801703:	89 d8                	mov    %ebx,%eax
  801705:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801708:	5b                   	pop    %ebx
  801709:	5e                   	pop    %esi
  80170a:	5d                   	pop    %ebp
  80170b:	c3                   	ret    
		fd_close(fd, 0);
  80170c:	83 ec 08             	sub    $0x8,%esp
  80170f:	6a 00                	push   $0x0
  801711:	ff 75 f4             	pushl  -0xc(%ebp)
  801714:	e8 10 f9 ff ff       	call   801029 <fd_close>
		return r;
  801719:	83 c4 10             	add    $0x10,%esp
  80171c:	eb e5                	jmp    801703 <open+0x70>
		return -E_BAD_PATH;
  80171e:	bb f4 ff ff ff       	mov    $0xfffffff4,%ebx
  801723:	eb de                	jmp    801703 <open+0x70>

00801725 <sync>:


// Synchronize disk with buffer cache
int
sync(void)
{
  801725:	f3 0f 1e fb          	endbr32 
  801729:	55                   	push   %ebp
  80172a:	89 e5                	mov    %esp,%ebp
  80172c:	83 ec 08             	sub    $0x8,%esp
	// Ask the file server to update the disk
	// by writing any dirty blocks in the buffer cache.

	return fsipc(FSREQ_SYNC, NULL);
  80172f:	ba 00 00 00 00       	mov    $0x0,%edx
  801734:	b8 08 00 00 00       	mov    $0x8,%eax
  801739:	e8 87 fd ff ff       	call   8014c5 <fsipc>
}
  80173e:	c9                   	leave  
  80173f:	c3                   	ret    

00801740 <devpipe_stat>:
	return i;
}

static int
devpipe_stat(struct Fd *fd, struct Stat *stat)
{
  801740:	f3 0f 1e fb          	endbr32 
  801744:	55                   	push   %ebp
  801745:	89 e5                	mov    %esp,%ebp
  801747:	56                   	push   %esi
  801748:	53                   	push   %ebx
  801749:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	struct Pipe *p = (struct Pipe*) fd2data(fd);
  80174c:	83 ec 0c             	sub    $0xc,%esp
  80174f:	ff 75 08             	pushl  0x8(%ebp)
  801752:	e8 b3 f7 ff ff       	call   800f0a <fd2data>
  801757:	89 c6                	mov    %eax,%esi
	strcpy(stat->st_name, "<pipe>");
  801759:	83 c4 08             	add    $0x8,%esp
  80175c:	68 87 23 80 00       	push   $0x802387
  801761:	53                   	push   %ebx
  801762:	e8 26 f0 ff ff       	call   80078d <strcpy>
	stat->st_size = p->p_wpos - p->p_rpos;
  801767:	8b 46 04             	mov    0x4(%esi),%eax
  80176a:	2b 06                	sub    (%esi),%eax
  80176c:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	stat->st_isdir = 0;
  801772:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  801779:	00 00 00 
	stat->st_dev = &devpipe;
  80177c:	c7 83 88 00 00 00 20 	movl   $0x803020,0x88(%ebx)
  801783:	30 80 00 
	return 0;
}
  801786:	b8 00 00 00 00       	mov    $0x0,%eax
  80178b:	8d 65 f8             	lea    -0x8(%ebp),%esp
  80178e:	5b                   	pop    %ebx
  80178f:	5e                   	pop    %esi
  801790:	5d                   	pop    %ebp
  801791:	c3                   	ret    

00801792 <devpipe_close>:

static int
devpipe_close(struct Fd *fd)
{
  801792:	f3 0f 1e fb          	endbr32 
  801796:	55                   	push   %ebp
  801797:	89 e5                	mov    %esp,%ebp
  801799:	53                   	push   %ebx
  80179a:	83 ec 0c             	sub    $0xc,%esp
  80179d:	8b 5d 08             	mov    0x8(%ebp),%ebx
	(void) sys_page_unmap(0, fd);
  8017a0:	53                   	push   %ebx
  8017a1:	6a 00                	push   $0x0
  8017a3:	e8 b4 f4 ff ff       	call   800c5c <sys_page_unmap>
	return sys_page_unmap(0, fd2data(fd));
  8017a8:	89 1c 24             	mov    %ebx,(%esp)
  8017ab:	e8 5a f7 ff ff       	call   800f0a <fd2data>
  8017b0:	83 c4 08             	add    $0x8,%esp
  8017b3:	50                   	push   %eax
  8017b4:	6a 00                	push   $0x0
  8017b6:	e8 a1 f4 ff ff       	call   800c5c <sys_page_unmap>
}
  8017bb:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8017be:	c9                   	leave  
  8017bf:	c3                   	ret    

008017c0 <_pipeisclosed>:
{
  8017c0:	55                   	push   %ebp
  8017c1:	89 e5                	mov    %esp,%ebp
  8017c3:	57                   	push   %edi
  8017c4:	56                   	push   %esi
  8017c5:	53                   	push   %ebx
  8017c6:	83 ec 1c             	sub    $0x1c,%esp
  8017c9:	89 c7                	mov    %eax,%edi
  8017cb:	89 d6                	mov    %edx,%esi
		n = thisenv->env_runs;
  8017cd:	a1 04 40 80 00       	mov    0x804004,%eax
  8017d2:	8b 58 58             	mov    0x58(%eax),%ebx
		ret = pageref(fd) == pageref(p);
  8017d5:	83 ec 0c             	sub    $0xc,%esp
  8017d8:	57                   	push   %edi
  8017d9:	e8 a7 04 00 00       	call   801c85 <pageref>
  8017de:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  8017e1:	89 34 24             	mov    %esi,(%esp)
  8017e4:	e8 9c 04 00 00       	call   801c85 <pageref>
		nn = thisenv->env_runs;
  8017e9:	8b 15 04 40 80 00    	mov    0x804004,%edx
  8017ef:	8b 4a 58             	mov    0x58(%edx),%ecx
		if (n == nn)
  8017f2:	83 c4 10             	add    $0x10,%esp
  8017f5:	39 cb                	cmp    %ecx,%ebx
  8017f7:	74 1b                	je     801814 <_pipeisclosed+0x54>
		if (n != nn && ret == 1)
  8017f9:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  8017fc:	75 cf                	jne    8017cd <_pipeisclosed+0xd>
			cprintf("pipe race avoided\n", n, thisenv->env_runs, ret);
  8017fe:	8b 42 58             	mov    0x58(%edx),%eax
  801801:	6a 01                	push   $0x1
  801803:	50                   	push   %eax
  801804:	53                   	push   %ebx
  801805:	68 8e 23 80 00       	push   $0x80238e
  80180a:	e8 a5 e9 ff ff       	call   8001b4 <cprintf>
  80180f:	83 c4 10             	add    $0x10,%esp
  801812:	eb b9                	jmp    8017cd <_pipeisclosed+0xd>
		ret = pageref(fd) == pageref(p);
  801814:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  801817:	0f 94 c0             	sete   %al
  80181a:	0f b6 c0             	movzbl %al,%eax
}
  80181d:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801820:	5b                   	pop    %ebx
  801821:	5e                   	pop    %esi
  801822:	5f                   	pop    %edi
  801823:	5d                   	pop    %ebp
  801824:	c3                   	ret    

00801825 <devpipe_write>:
{
  801825:	f3 0f 1e fb          	endbr32 
  801829:	55                   	push   %ebp
  80182a:	89 e5                	mov    %esp,%ebp
  80182c:	57                   	push   %edi
  80182d:	56                   	push   %esi
  80182e:	53                   	push   %ebx
  80182f:	83 ec 28             	sub    $0x28,%esp
  801832:	8b 75 08             	mov    0x8(%ebp),%esi
	p = (struct Pipe*) fd2data(fd);
  801835:	56                   	push   %esi
  801836:	e8 cf f6 ff ff       	call   800f0a <fd2data>
  80183b:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  80183d:	83 c4 10             	add    $0x10,%esp
  801840:	bf 00 00 00 00       	mov    $0x0,%edi
  801845:	3b 7d 10             	cmp    0x10(%ebp),%edi
  801848:	74 4f                	je     801899 <devpipe_write+0x74>
		while (p->p_wpos >= p->p_rpos + sizeof(p->p_buf)) {
  80184a:	8b 43 04             	mov    0x4(%ebx),%eax
  80184d:	8b 0b                	mov    (%ebx),%ecx
  80184f:	8d 51 20             	lea    0x20(%ecx),%edx
  801852:	39 d0                	cmp    %edx,%eax
  801854:	72 14                	jb     80186a <devpipe_write+0x45>
			if (_pipeisclosed(fd, p))
  801856:	89 da                	mov    %ebx,%edx
  801858:	89 f0                	mov    %esi,%eax
  80185a:	e8 61 ff ff ff       	call   8017c0 <_pipeisclosed>
  80185f:	85 c0                	test   %eax,%eax
  801861:	75 3b                	jne    80189e <devpipe_write+0x79>
			sys_yield();
  801863:	e8 44 f3 ff ff       	call   800bac <sys_yield>
  801868:	eb e0                	jmp    80184a <devpipe_write+0x25>
		p->p_buf[p->p_wpos % PIPEBUFSIZ] = buf[i];
  80186a:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  80186d:	0f b6 0c 39          	movzbl (%ecx,%edi,1),%ecx
  801871:	88 4d e7             	mov    %cl,-0x19(%ebp)
  801874:	89 c2                	mov    %eax,%edx
  801876:	c1 fa 1f             	sar    $0x1f,%edx
  801879:	89 d1                	mov    %edx,%ecx
  80187b:	c1 e9 1b             	shr    $0x1b,%ecx
  80187e:	8d 14 08             	lea    (%eax,%ecx,1),%edx
  801881:	83 e2 1f             	and    $0x1f,%edx
  801884:	29 ca                	sub    %ecx,%edx
  801886:	0f b6 4d e7          	movzbl -0x19(%ebp),%ecx
  80188a:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
		p->p_wpos++;
  80188e:	83 c0 01             	add    $0x1,%eax
  801891:	89 43 04             	mov    %eax,0x4(%ebx)
	for (i = 0; i < n; i++) {
  801894:	83 c7 01             	add    $0x1,%edi
  801897:	eb ac                	jmp    801845 <devpipe_write+0x20>
	return i;
  801899:	8b 45 10             	mov    0x10(%ebp),%eax
  80189c:	eb 05                	jmp    8018a3 <devpipe_write+0x7e>
				return 0;
  80189e:	b8 00 00 00 00       	mov    $0x0,%eax
}
  8018a3:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8018a6:	5b                   	pop    %ebx
  8018a7:	5e                   	pop    %esi
  8018a8:	5f                   	pop    %edi
  8018a9:	5d                   	pop    %ebp
  8018aa:	c3                   	ret    

008018ab <devpipe_read>:
{
  8018ab:	f3 0f 1e fb          	endbr32 
  8018af:	55                   	push   %ebp
  8018b0:	89 e5                	mov    %esp,%ebp
  8018b2:	57                   	push   %edi
  8018b3:	56                   	push   %esi
  8018b4:	53                   	push   %ebx
  8018b5:	83 ec 18             	sub    $0x18,%esp
  8018b8:	8b 7d 08             	mov    0x8(%ebp),%edi
	p = (struct Pipe*)fd2data(fd);
  8018bb:	57                   	push   %edi
  8018bc:	e8 49 f6 ff ff       	call   800f0a <fd2data>
  8018c1:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  8018c3:	83 c4 10             	add    $0x10,%esp
  8018c6:	be 00 00 00 00       	mov    $0x0,%esi
  8018cb:	3b 75 10             	cmp    0x10(%ebp),%esi
  8018ce:	75 14                	jne    8018e4 <devpipe_read+0x39>
	return i;
  8018d0:	8b 45 10             	mov    0x10(%ebp),%eax
  8018d3:	eb 02                	jmp    8018d7 <devpipe_read+0x2c>
				return i;
  8018d5:	89 f0                	mov    %esi,%eax
}
  8018d7:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8018da:	5b                   	pop    %ebx
  8018db:	5e                   	pop    %esi
  8018dc:	5f                   	pop    %edi
  8018dd:	5d                   	pop    %ebp
  8018de:	c3                   	ret    
			sys_yield();
  8018df:	e8 c8 f2 ff ff       	call   800bac <sys_yield>
		while (p->p_rpos == p->p_wpos) {
  8018e4:	8b 03                	mov    (%ebx),%eax
  8018e6:	3b 43 04             	cmp    0x4(%ebx),%eax
  8018e9:	75 18                	jne    801903 <devpipe_read+0x58>
			if (i > 0)
  8018eb:	85 f6                	test   %esi,%esi
  8018ed:	75 e6                	jne    8018d5 <devpipe_read+0x2a>
			if (_pipeisclosed(fd, p))
  8018ef:	89 da                	mov    %ebx,%edx
  8018f1:	89 f8                	mov    %edi,%eax
  8018f3:	e8 c8 fe ff ff       	call   8017c0 <_pipeisclosed>
  8018f8:	85 c0                	test   %eax,%eax
  8018fa:	74 e3                	je     8018df <devpipe_read+0x34>
				return 0;
  8018fc:	b8 00 00 00 00       	mov    $0x0,%eax
  801901:	eb d4                	jmp    8018d7 <devpipe_read+0x2c>
		buf[i] = p->p_buf[p->p_rpos % PIPEBUFSIZ];
  801903:	99                   	cltd   
  801904:	c1 ea 1b             	shr    $0x1b,%edx
  801907:	01 d0                	add    %edx,%eax
  801909:	83 e0 1f             	and    $0x1f,%eax
  80190c:	29 d0                	sub    %edx,%eax
  80190e:	0f b6 44 03 08       	movzbl 0x8(%ebx,%eax,1),%eax
  801913:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801916:	88 04 31             	mov    %al,(%ecx,%esi,1)
		p->p_rpos++;
  801919:	83 03 01             	addl   $0x1,(%ebx)
	for (i = 0; i < n; i++) {
  80191c:	83 c6 01             	add    $0x1,%esi
  80191f:	eb aa                	jmp    8018cb <devpipe_read+0x20>

00801921 <pipe>:
{
  801921:	f3 0f 1e fb          	endbr32 
  801925:	55                   	push   %ebp
  801926:	89 e5                	mov    %esp,%ebp
  801928:	56                   	push   %esi
  801929:	53                   	push   %ebx
  80192a:	83 ec 1c             	sub    $0x1c,%esp
	if ((r = fd_alloc(&fd0)) < 0
  80192d:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801930:	50                   	push   %eax
  801931:	e8 ef f5 ff ff       	call   800f25 <fd_alloc>
  801936:	89 c3                	mov    %eax,%ebx
  801938:	83 c4 10             	add    $0x10,%esp
  80193b:	85 c0                	test   %eax,%eax
  80193d:	0f 88 23 01 00 00    	js     801a66 <pipe+0x145>
	    || (r = sys_page_alloc(0, fd0, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  801943:	83 ec 04             	sub    $0x4,%esp
  801946:	68 07 04 00 00       	push   $0x407
  80194b:	ff 75 f4             	pushl  -0xc(%ebp)
  80194e:	6a 00                	push   $0x0
  801950:	e8 7a f2 ff ff       	call   800bcf <sys_page_alloc>
  801955:	89 c3                	mov    %eax,%ebx
  801957:	83 c4 10             	add    $0x10,%esp
  80195a:	85 c0                	test   %eax,%eax
  80195c:	0f 88 04 01 00 00    	js     801a66 <pipe+0x145>
	if ((r = fd_alloc(&fd1)) < 0
  801962:	83 ec 0c             	sub    $0xc,%esp
  801965:	8d 45 f0             	lea    -0x10(%ebp),%eax
  801968:	50                   	push   %eax
  801969:	e8 b7 f5 ff ff       	call   800f25 <fd_alloc>
  80196e:	89 c3                	mov    %eax,%ebx
  801970:	83 c4 10             	add    $0x10,%esp
  801973:	85 c0                	test   %eax,%eax
  801975:	0f 88 db 00 00 00    	js     801a56 <pipe+0x135>
	    || (r = sys_page_alloc(0, fd1, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  80197b:	83 ec 04             	sub    $0x4,%esp
  80197e:	68 07 04 00 00       	push   $0x407
  801983:	ff 75 f0             	pushl  -0x10(%ebp)
  801986:	6a 00                	push   $0x0
  801988:	e8 42 f2 ff ff       	call   800bcf <sys_page_alloc>
  80198d:	89 c3                	mov    %eax,%ebx
  80198f:	83 c4 10             	add    $0x10,%esp
  801992:	85 c0                	test   %eax,%eax
  801994:	0f 88 bc 00 00 00    	js     801a56 <pipe+0x135>
	va = fd2data(fd0);
  80199a:	83 ec 0c             	sub    $0xc,%esp
  80199d:	ff 75 f4             	pushl  -0xc(%ebp)
  8019a0:	e8 65 f5 ff ff       	call   800f0a <fd2data>
  8019a5:	89 c6                	mov    %eax,%esi
	if ((r = sys_page_alloc(0, va, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  8019a7:	83 c4 0c             	add    $0xc,%esp
  8019aa:	68 07 04 00 00       	push   $0x407
  8019af:	50                   	push   %eax
  8019b0:	6a 00                	push   $0x0
  8019b2:	e8 18 f2 ff ff       	call   800bcf <sys_page_alloc>
  8019b7:	89 c3                	mov    %eax,%ebx
  8019b9:	83 c4 10             	add    $0x10,%esp
  8019bc:	85 c0                	test   %eax,%eax
  8019be:	0f 88 82 00 00 00    	js     801a46 <pipe+0x125>
	if ((r = sys_page_map(0, va, 0, fd2data(fd1), PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  8019c4:	83 ec 0c             	sub    $0xc,%esp
  8019c7:	ff 75 f0             	pushl  -0x10(%ebp)
  8019ca:	e8 3b f5 ff ff       	call   800f0a <fd2data>
  8019cf:	c7 04 24 07 04 00 00 	movl   $0x407,(%esp)
  8019d6:	50                   	push   %eax
  8019d7:	6a 00                	push   $0x0
  8019d9:	56                   	push   %esi
  8019da:	6a 00                	push   $0x0
  8019dc:	e8 35 f2 ff ff       	call   800c16 <sys_page_map>
  8019e1:	89 c3                	mov    %eax,%ebx
  8019e3:	83 c4 20             	add    $0x20,%esp
  8019e6:	85 c0                	test   %eax,%eax
  8019e8:	78 4e                	js     801a38 <pipe+0x117>
	fd0->fd_dev_id = devpipe.dev_id;
  8019ea:	a1 20 30 80 00       	mov    0x803020,%eax
  8019ef:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8019f2:	89 02                	mov    %eax,(%edx)
	fd0->fd_omode = O_RDONLY;
  8019f4:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8019f7:	c7 42 08 00 00 00 00 	movl   $0x0,0x8(%edx)
	fd1->fd_dev_id = devpipe.dev_id;
  8019fe:	8b 55 f0             	mov    -0x10(%ebp),%edx
  801a01:	89 02                	mov    %eax,(%edx)
	fd1->fd_omode = O_WRONLY;
  801a03:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801a06:	c7 40 08 01 00 00 00 	movl   $0x1,0x8(%eax)
	pfd[0] = fd2num(fd0);
  801a0d:	83 ec 0c             	sub    $0xc,%esp
  801a10:	ff 75 f4             	pushl  -0xc(%ebp)
  801a13:	e8 de f4 ff ff       	call   800ef6 <fd2num>
  801a18:	8b 4d 08             	mov    0x8(%ebp),%ecx
  801a1b:	89 01                	mov    %eax,(%ecx)
	pfd[1] = fd2num(fd1);
  801a1d:	83 c4 04             	add    $0x4,%esp
  801a20:	ff 75 f0             	pushl  -0x10(%ebp)
  801a23:	e8 ce f4 ff ff       	call   800ef6 <fd2num>
  801a28:	8b 4d 08             	mov    0x8(%ebp),%ecx
  801a2b:	89 41 04             	mov    %eax,0x4(%ecx)
	return 0;
  801a2e:	83 c4 10             	add    $0x10,%esp
  801a31:	bb 00 00 00 00       	mov    $0x0,%ebx
  801a36:	eb 2e                	jmp    801a66 <pipe+0x145>
	sys_page_unmap(0, va);
  801a38:	83 ec 08             	sub    $0x8,%esp
  801a3b:	56                   	push   %esi
  801a3c:	6a 00                	push   $0x0
  801a3e:	e8 19 f2 ff ff       	call   800c5c <sys_page_unmap>
  801a43:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd1);
  801a46:	83 ec 08             	sub    $0x8,%esp
  801a49:	ff 75 f0             	pushl  -0x10(%ebp)
  801a4c:	6a 00                	push   $0x0
  801a4e:	e8 09 f2 ff ff       	call   800c5c <sys_page_unmap>
  801a53:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd0);
  801a56:	83 ec 08             	sub    $0x8,%esp
  801a59:	ff 75 f4             	pushl  -0xc(%ebp)
  801a5c:	6a 00                	push   $0x0
  801a5e:	e8 f9 f1 ff ff       	call   800c5c <sys_page_unmap>
  801a63:	83 c4 10             	add    $0x10,%esp
}
  801a66:	89 d8                	mov    %ebx,%eax
  801a68:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801a6b:	5b                   	pop    %ebx
  801a6c:	5e                   	pop    %esi
  801a6d:	5d                   	pop    %ebp
  801a6e:	c3                   	ret    

00801a6f <pipeisclosed>:
{
  801a6f:	f3 0f 1e fb          	endbr32 
  801a73:	55                   	push   %ebp
  801a74:	89 e5                	mov    %esp,%ebp
  801a76:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801a79:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801a7c:	50                   	push   %eax
  801a7d:	ff 75 08             	pushl  0x8(%ebp)
  801a80:	e8 f6 f4 ff ff       	call   800f7b <fd_lookup>
  801a85:	83 c4 10             	add    $0x10,%esp
  801a88:	85 c0                	test   %eax,%eax
  801a8a:	78 18                	js     801aa4 <pipeisclosed+0x35>
	p = (struct Pipe*) fd2data(fd);
  801a8c:	83 ec 0c             	sub    $0xc,%esp
  801a8f:	ff 75 f4             	pushl  -0xc(%ebp)
  801a92:	e8 73 f4 ff ff       	call   800f0a <fd2data>
  801a97:	89 c2                	mov    %eax,%edx
	return _pipeisclosed(fd, p);
  801a99:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801a9c:	e8 1f fd ff ff       	call   8017c0 <_pipeisclosed>
  801aa1:	83 c4 10             	add    $0x10,%esp
}
  801aa4:	c9                   	leave  
  801aa5:	c3                   	ret    

00801aa6 <devcons_close>:
	return tot;
}

static int
devcons_close(struct Fd *fd)
{
  801aa6:	f3 0f 1e fb          	endbr32 
	USED(fd);

	return 0;
}
  801aaa:	b8 00 00 00 00       	mov    $0x0,%eax
  801aaf:	c3                   	ret    

00801ab0 <devcons_stat>:

static int
devcons_stat(struct Fd *fd, struct Stat *stat)
{
  801ab0:	f3 0f 1e fb          	endbr32 
  801ab4:	55                   	push   %ebp
  801ab5:	89 e5                	mov    %esp,%ebp
  801ab7:	83 ec 10             	sub    $0x10,%esp
	strcpy(stat->st_name, "<cons>");
  801aba:	68 a6 23 80 00       	push   $0x8023a6
  801abf:	ff 75 0c             	pushl  0xc(%ebp)
  801ac2:	e8 c6 ec ff ff       	call   80078d <strcpy>
	return 0;
}
  801ac7:	b8 00 00 00 00       	mov    $0x0,%eax
  801acc:	c9                   	leave  
  801acd:	c3                   	ret    

00801ace <devcons_write>:
{
  801ace:	f3 0f 1e fb          	endbr32 
  801ad2:	55                   	push   %ebp
  801ad3:	89 e5                	mov    %esp,%ebp
  801ad5:	57                   	push   %edi
  801ad6:	56                   	push   %esi
  801ad7:	53                   	push   %ebx
  801ad8:	81 ec 8c 00 00 00    	sub    $0x8c,%esp
	for (tot = 0; tot < n; tot += m) {
  801ade:	be 00 00 00 00       	mov    $0x0,%esi
		memmove(buf, (char*)vbuf + tot, m);
  801ae3:	8d bd 68 ff ff ff    	lea    -0x98(%ebp),%edi
	for (tot = 0; tot < n; tot += m) {
  801ae9:	3b 75 10             	cmp    0x10(%ebp),%esi
  801aec:	73 31                	jae    801b1f <devcons_write+0x51>
		m = n - tot;
  801aee:	8b 5d 10             	mov    0x10(%ebp),%ebx
  801af1:	29 f3                	sub    %esi,%ebx
  801af3:	83 fb 7f             	cmp    $0x7f,%ebx
  801af6:	b8 7f 00 00 00       	mov    $0x7f,%eax
  801afb:	0f 47 d8             	cmova  %eax,%ebx
		memmove(buf, (char*)vbuf + tot, m);
  801afe:	83 ec 04             	sub    $0x4,%esp
  801b01:	53                   	push   %ebx
  801b02:	89 f0                	mov    %esi,%eax
  801b04:	03 45 0c             	add    0xc(%ebp),%eax
  801b07:	50                   	push   %eax
  801b08:	57                   	push   %edi
  801b09:	e8 35 ee ff ff       	call   800943 <memmove>
		sys_cputs(buf, m);
  801b0e:	83 c4 08             	add    $0x8,%esp
  801b11:	53                   	push   %ebx
  801b12:	57                   	push   %edi
  801b13:	e8 e7 ef ff ff       	call   800aff <sys_cputs>
	for (tot = 0; tot < n; tot += m) {
  801b18:	01 de                	add    %ebx,%esi
  801b1a:	83 c4 10             	add    $0x10,%esp
  801b1d:	eb ca                	jmp    801ae9 <devcons_write+0x1b>
}
  801b1f:	89 f0                	mov    %esi,%eax
  801b21:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801b24:	5b                   	pop    %ebx
  801b25:	5e                   	pop    %esi
  801b26:	5f                   	pop    %edi
  801b27:	5d                   	pop    %ebp
  801b28:	c3                   	ret    

00801b29 <devcons_read>:
{
  801b29:	f3 0f 1e fb          	endbr32 
  801b2d:	55                   	push   %ebp
  801b2e:	89 e5                	mov    %esp,%ebp
  801b30:	83 ec 08             	sub    $0x8,%esp
  801b33:	b8 00 00 00 00       	mov    $0x0,%eax
	if (n == 0)
  801b38:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  801b3c:	74 21                	je     801b5f <devcons_read+0x36>
	while ((c = sys_cgetc()) == 0)
  801b3e:	e8 de ef ff ff       	call   800b21 <sys_cgetc>
  801b43:	85 c0                	test   %eax,%eax
  801b45:	75 07                	jne    801b4e <devcons_read+0x25>
		sys_yield();
  801b47:	e8 60 f0 ff ff       	call   800bac <sys_yield>
  801b4c:	eb f0                	jmp    801b3e <devcons_read+0x15>
	if (c < 0)
  801b4e:	78 0f                	js     801b5f <devcons_read+0x36>
	if (c == 0x04)	// ctl-d is eof
  801b50:	83 f8 04             	cmp    $0x4,%eax
  801b53:	74 0c                	je     801b61 <devcons_read+0x38>
	*(char*)vbuf = c;
  801b55:	8b 55 0c             	mov    0xc(%ebp),%edx
  801b58:	88 02                	mov    %al,(%edx)
	return 1;
  801b5a:	b8 01 00 00 00       	mov    $0x1,%eax
}
  801b5f:	c9                   	leave  
  801b60:	c3                   	ret    
		return 0;
  801b61:	b8 00 00 00 00       	mov    $0x0,%eax
  801b66:	eb f7                	jmp    801b5f <devcons_read+0x36>

00801b68 <cputchar>:
{
  801b68:	f3 0f 1e fb          	endbr32 
  801b6c:	55                   	push   %ebp
  801b6d:	89 e5                	mov    %esp,%ebp
  801b6f:	83 ec 20             	sub    $0x20,%esp
	char c = ch;
  801b72:	8b 45 08             	mov    0x8(%ebp),%eax
  801b75:	88 45 f7             	mov    %al,-0x9(%ebp)
	sys_cputs(&c, 1);
  801b78:	6a 01                	push   $0x1
  801b7a:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801b7d:	50                   	push   %eax
  801b7e:	e8 7c ef ff ff       	call   800aff <sys_cputs>
}
  801b83:	83 c4 10             	add    $0x10,%esp
  801b86:	c9                   	leave  
  801b87:	c3                   	ret    

00801b88 <getchar>:
{
  801b88:	f3 0f 1e fb          	endbr32 
  801b8c:	55                   	push   %ebp
  801b8d:	89 e5                	mov    %esp,%ebp
  801b8f:	83 ec 1c             	sub    $0x1c,%esp
	r = read(0, &c, 1);
  801b92:	6a 01                	push   $0x1
  801b94:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801b97:	50                   	push   %eax
  801b98:	6a 00                	push   $0x0
  801b9a:	e8 5f f6 ff ff       	call   8011fe <read>
	if (r < 0)
  801b9f:	83 c4 10             	add    $0x10,%esp
  801ba2:	85 c0                	test   %eax,%eax
  801ba4:	78 06                	js     801bac <getchar+0x24>
	if (r < 1)
  801ba6:	74 06                	je     801bae <getchar+0x26>
	return c;
  801ba8:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
}
  801bac:	c9                   	leave  
  801bad:	c3                   	ret    
		return -E_EOF;
  801bae:	b8 f8 ff ff ff       	mov    $0xfffffff8,%eax
  801bb3:	eb f7                	jmp    801bac <getchar+0x24>

00801bb5 <iscons>:
{
  801bb5:	f3 0f 1e fb          	endbr32 
  801bb9:	55                   	push   %ebp
  801bba:	89 e5                	mov    %esp,%ebp
  801bbc:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801bbf:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801bc2:	50                   	push   %eax
  801bc3:	ff 75 08             	pushl  0x8(%ebp)
  801bc6:	e8 b0 f3 ff ff       	call   800f7b <fd_lookup>
  801bcb:	83 c4 10             	add    $0x10,%esp
  801bce:	85 c0                	test   %eax,%eax
  801bd0:	78 11                	js     801be3 <iscons+0x2e>
	return fd->fd_dev_id == devcons.dev_id;
  801bd2:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801bd5:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  801bdb:	39 10                	cmp    %edx,(%eax)
  801bdd:	0f 94 c0             	sete   %al
  801be0:	0f b6 c0             	movzbl %al,%eax
}
  801be3:	c9                   	leave  
  801be4:	c3                   	ret    

00801be5 <opencons>:
{
  801be5:	f3 0f 1e fb          	endbr32 
  801be9:	55                   	push   %ebp
  801bea:	89 e5                	mov    %esp,%ebp
  801bec:	83 ec 24             	sub    $0x24,%esp
	if ((r = fd_alloc(&fd)) < 0)
  801bef:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801bf2:	50                   	push   %eax
  801bf3:	e8 2d f3 ff ff       	call   800f25 <fd_alloc>
  801bf8:	83 c4 10             	add    $0x10,%esp
  801bfb:	85 c0                	test   %eax,%eax
  801bfd:	78 3a                	js     801c39 <opencons+0x54>
	if ((r = sys_page_alloc(0, fd, PTE_P|PTE_U|PTE_W|PTE_SHARE)) < 0)
  801bff:	83 ec 04             	sub    $0x4,%esp
  801c02:	68 07 04 00 00       	push   $0x407
  801c07:	ff 75 f4             	pushl  -0xc(%ebp)
  801c0a:	6a 00                	push   $0x0
  801c0c:	e8 be ef ff ff       	call   800bcf <sys_page_alloc>
  801c11:	83 c4 10             	add    $0x10,%esp
  801c14:	85 c0                	test   %eax,%eax
  801c16:	78 21                	js     801c39 <opencons+0x54>
	fd->fd_dev_id = devcons.dev_id;
  801c18:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801c1b:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  801c21:	89 10                	mov    %edx,(%eax)
	fd->fd_omode = O_RDWR;
  801c23:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801c26:	c7 40 08 02 00 00 00 	movl   $0x2,0x8(%eax)
	return fd2num(fd);
  801c2d:	83 ec 0c             	sub    $0xc,%esp
  801c30:	50                   	push   %eax
  801c31:	e8 c0 f2 ff ff       	call   800ef6 <fd2num>
  801c36:	83 c4 10             	add    $0x10,%esp
}
  801c39:	c9                   	leave  
  801c3a:	c3                   	ret    

00801c3b <_panic>:
 * It prints "panic: <message>", then causes a breakpoint exception,
 * which causes JOS to enter the JOS kernel monitor.
 */
void
_panic(const char *file, int line, const char *fmt, ...)
{
  801c3b:	f3 0f 1e fb          	endbr32 
  801c3f:	55                   	push   %ebp
  801c40:	89 e5                	mov    %esp,%ebp
  801c42:	56                   	push   %esi
  801c43:	53                   	push   %ebx
	va_list ap;

	va_start(ap, fmt);
  801c44:	8d 5d 14             	lea    0x14(%ebp),%ebx

	// Print the panic message
	cprintf("[%08x] user panic in %s at %s:%d: ",
  801c47:	8b 35 00 30 80 00    	mov    0x803000,%esi
  801c4d:	e8 37 ef ff ff       	call   800b89 <sys_getenvid>
  801c52:	83 ec 0c             	sub    $0xc,%esp
  801c55:	ff 75 0c             	pushl  0xc(%ebp)
  801c58:	ff 75 08             	pushl  0x8(%ebp)
  801c5b:	56                   	push   %esi
  801c5c:	50                   	push   %eax
  801c5d:	68 b4 23 80 00       	push   $0x8023b4
  801c62:	e8 4d e5 ff ff       	call   8001b4 <cprintf>
		sys_getenvid(), binaryname, file, line);
	vcprintf(fmt, ap);
  801c67:	83 c4 18             	add    $0x18,%esp
  801c6a:	53                   	push   %ebx
  801c6b:	ff 75 10             	pushl  0x10(%ebp)
  801c6e:	e8 ec e4 ff ff       	call   80015f <vcprintf>
	cprintf("\n");
  801c73:	c7 04 24 9f 23 80 00 	movl   $0x80239f,(%esp)
  801c7a:	e8 35 e5 ff ff       	call   8001b4 <cprintf>
  801c7f:	83 c4 10             	add    $0x10,%esp

	// Cause a breakpoint exception
	while (1)
		asm volatile("int3");
  801c82:	cc                   	int3   
  801c83:	eb fd                	jmp    801c82 <_panic+0x47>

00801c85 <pageref>:
#include <inc/lib.h>

int
pageref(void *v)
{
  801c85:	f3 0f 1e fb          	endbr32 
  801c89:	55                   	push   %ebp
  801c8a:	89 e5                	mov    %esp,%ebp
  801c8c:	8b 45 08             	mov    0x8(%ebp),%eax
	pte_t pte;

	if (!(uvpd[PDX(v)] & PTE_P))
  801c8f:	89 c2                	mov    %eax,%edx
  801c91:	c1 ea 16             	shr    $0x16,%edx
  801c94:	8b 0c 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%ecx
		return 0;
  801c9b:	ba 00 00 00 00       	mov    $0x0,%edx
	if (!(uvpd[PDX(v)] & PTE_P))
  801ca0:	f6 c1 01             	test   $0x1,%cl
  801ca3:	74 1c                	je     801cc1 <pageref+0x3c>
	pte = uvpt[PGNUM(v)];
  801ca5:	c1 e8 0c             	shr    $0xc,%eax
  801ca8:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
	if (!(pte & PTE_P))
  801caf:	a8 01                	test   $0x1,%al
  801cb1:	74 0e                	je     801cc1 <pageref+0x3c>
		return 0;
	return pages[PGNUM(pte)].pp_ref;
  801cb3:	c1 e8 0c             	shr    $0xc,%eax
  801cb6:	0f b7 14 c5 04 00 00 	movzwl -0x10fffffc(,%eax,8),%edx
  801cbd:	ef 
  801cbe:	0f b7 d2             	movzwl %dx,%edx
}
  801cc1:	89 d0                	mov    %edx,%eax
  801cc3:	5d                   	pop    %ebp
  801cc4:	c3                   	ret    
  801cc5:	66 90                	xchg   %ax,%ax
  801cc7:	66 90                	xchg   %ax,%ax
  801cc9:	66 90                	xchg   %ax,%ax
  801ccb:	66 90                	xchg   %ax,%ax
  801ccd:	66 90                	xchg   %ax,%ax
  801ccf:	90                   	nop

00801cd0 <__udivdi3>:
  801cd0:	f3 0f 1e fb          	endbr32 
  801cd4:	55                   	push   %ebp
  801cd5:	57                   	push   %edi
  801cd6:	56                   	push   %esi
  801cd7:	53                   	push   %ebx
  801cd8:	83 ec 1c             	sub    $0x1c,%esp
  801cdb:	8b 54 24 3c          	mov    0x3c(%esp),%edx
  801cdf:	8b 6c 24 30          	mov    0x30(%esp),%ebp
  801ce3:	8b 74 24 34          	mov    0x34(%esp),%esi
  801ce7:	8b 5c 24 38          	mov    0x38(%esp),%ebx
  801ceb:	85 d2                	test   %edx,%edx
  801ced:	75 19                	jne    801d08 <__udivdi3+0x38>
  801cef:	39 f3                	cmp    %esi,%ebx
  801cf1:	76 4d                	jbe    801d40 <__udivdi3+0x70>
  801cf3:	31 ff                	xor    %edi,%edi
  801cf5:	89 e8                	mov    %ebp,%eax
  801cf7:	89 f2                	mov    %esi,%edx
  801cf9:	f7 f3                	div    %ebx
  801cfb:	89 fa                	mov    %edi,%edx
  801cfd:	83 c4 1c             	add    $0x1c,%esp
  801d00:	5b                   	pop    %ebx
  801d01:	5e                   	pop    %esi
  801d02:	5f                   	pop    %edi
  801d03:	5d                   	pop    %ebp
  801d04:	c3                   	ret    
  801d05:	8d 76 00             	lea    0x0(%esi),%esi
  801d08:	39 f2                	cmp    %esi,%edx
  801d0a:	76 14                	jbe    801d20 <__udivdi3+0x50>
  801d0c:	31 ff                	xor    %edi,%edi
  801d0e:	31 c0                	xor    %eax,%eax
  801d10:	89 fa                	mov    %edi,%edx
  801d12:	83 c4 1c             	add    $0x1c,%esp
  801d15:	5b                   	pop    %ebx
  801d16:	5e                   	pop    %esi
  801d17:	5f                   	pop    %edi
  801d18:	5d                   	pop    %ebp
  801d19:	c3                   	ret    
  801d1a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  801d20:	0f bd fa             	bsr    %edx,%edi
  801d23:	83 f7 1f             	xor    $0x1f,%edi
  801d26:	75 48                	jne    801d70 <__udivdi3+0xa0>
  801d28:	39 f2                	cmp    %esi,%edx
  801d2a:	72 06                	jb     801d32 <__udivdi3+0x62>
  801d2c:	31 c0                	xor    %eax,%eax
  801d2e:	39 eb                	cmp    %ebp,%ebx
  801d30:	77 de                	ja     801d10 <__udivdi3+0x40>
  801d32:	b8 01 00 00 00       	mov    $0x1,%eax
  801d37:	eb d7                	jmp    801d10 <__udivdi3+0x40>
  801d39:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801d40:	89 d9                	mov    %ebx,%ecx
  801d42:	85 db                	test   %ebx,%ebx
  801d44:	75 0b                	jne    801d51 <__udivdi3+0x81>
  801d46:	b8 01 00 00 00       	mov    $0x1,%eax
  801d4b:	31 d2                	xor    %edx,%edx
  801d4d:	f7 f3                	div    %ebx
  801d4f:	89 c1                	mov    %eax,%ecx
  801d51:	31 d2                	xor    %edx,%edx
  801d53:	89 f0                	mov    %esi,%eax
  801d55:	f7 f1                	div    %ecx
  801d57:	89 c6                	mov    %eax,%esi
  801d59:	89 e8                	mov    %ebp,%eax
  801d5b:	89 f7                	mov    %esi,%edi
  801d5d:	f7 f1                	div    %ecx
  801d5f:	89 fa                	mov    %edi,%edx
  801d61:	83 c4 1c             	add    $0x1c,%esp
  801d64:	5b                   	pop    %ebx
  801d65:	5e                   	pop    %esi
  801d66:	5f                   	pop    %edi
  801d67:	5d                   	pop    %ebp
  801d68:	c3                   	ret    
  801d69:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801d70:	89 f9                	mov    %edi,%ecx
  801d72:	b8 20 00 00 00       	mov    $0x20,%eax
  801d77:	29 f8                	sub    %edi,%eax
  801d79:	d3 e2                	shl    %cl,%edx
  801d7b:	89 54 24 08          	mov    %edx,0x8(%esp)
  801d7f:	89 c1                	mov    %eax,%ecx
  801d81:	89 da                	mov    %ebx,%edx
  801d83:	d3 ea                	shr    %cl,%edx
  801d85:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  801d89:	09 d1                	or     %edx,%ecx
  801d8b:	89 f2                	mov    %esi,%edx
  801d8d:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  801d91:	89 f9                	mov    %edi,%ecx
  801d93:	d3 e3                	shl    %cl,%ebx
  801d95:	89 c1                	mov    %eax,%ecx
  801d97:	d3 ea                	shr    %cl,%edx
  801d99:	89 f9                	mov    %edi,%ecx
  801d9b:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  801d9f:	89 eb                	mov    %ebp,%ebx
  801da1:	d3 e6                	shl    %cl,%esi
  801da3:	89 c1                	mov    %eax,%ecx
  801da5:	d3 eb                	shr    %cl,%ebx
  801da7:	09 de                	or     %ebx,%esi
  801da9:	89 f0                	mov    %esi,%eax
  801dab:	f7 74 24 08          	divl   0x8(%esp)
  801daf:	89 d6                	mov    %edx,%esi
  801db1:	89 c3                	mov    %eax,%ebx
  801db3:	f7 64 24 0c          	mull   0xc(%esp)
  801db7:	39 d6                	cmp    %edx,%esi
  801db9:	72 15                	jb     801dd0 <__udivdi3+0x100>
  801dbb:	89 f9                	mov    %edi,%ecx
  801dbd:	d3 e5                	shl    %cl,%ebp
  801dbf:	39 c5                	cmp    %eax,%ebp
  801dc1:	73 04                	jae    801dc7 <__udivdi3+0xf7>
  801dc3:	39 d6                	cmp    %edx,%esi
  801dc5:	74 09                	je     801dd0 <__udivdi3+0x100>
  801dc7:	89 d8                	mov    %ebx,%eax
  801dc9:	31 ff                	xor    %edi,%edi
  801dcb:	e9 40 ff ff ff       	jmp    801d10 <__udivdi3+0x40>
  801dd0:	8d 43 ff             	lea    -0x1(%ebx),%eax
  801dd3:	31 ff                	xor    %edi,%edi
  801dd5:	e9 36 ff ff ff       	jmp    801d10 <__udivdi3+0x40>
  801dda:	66 90                	xchg   %ax,%ax
  801ddc:	66 90                	xchg   %ax,%ax
  801dde:	66 90                	xchg   %ax,%ax

00801de0 <__umoddi3>:
  801de0:	f3 0f 1e fb          	endbr32 
  801de4:	55                   	push   %ebp
  801de5:	57                   	push   %edi
  801de6:	56                   	push   %esi
  801de7:	53                   	push   %ebx
  801de8:	83 ec 1c             	sub    $0x1c,%esp
  801deb:	8b 44 24 3c          	mov    0x3c(%esp),%eax
  801def:	8b 74 24 30          	mov    0x30(%esp),%esi
  801df3:	8b 5c 24 34          	mov    0x34(%esp),%ebx
  801df7:	8b 7c 24 38          	mov    0x38(%esp),%edi
  801dfb:	85 c0                	test   %eax,%eax
  801dfd:	75 19                	jne    801e18 <__umoddi3+0x38>
  801dff:	39 df                	cmp    %ebx,%edi
  801e01:	76 5d                	jbe    801e60 <__umoddi3+0x80>
  801e03:	89 f0                	mov    %esi,%eax
  801e05:	89 da                	mov    %ebx,%edx
  801e07:	f7 f7                	div    %edi
  801e09:	89 d0                	mov    %edx,%eax
  801e0b:	31 d2                	xor    %edx,%edx
  801e0d:	83 c4 1c             	add    $0x1c,%esp
  801e10:	5b                   	pop    %ebx
  801e11:	5e                   	pop    %esi
  801e12:	5f                   	pop    %edi
  801e13:	5d                   	pop    %ebp
  801e14:	c3                   	ret    
  801e15:	8d 76 00             	lea    0x0(%esi),%esi
  801e18:	89 f2                	mov    %esi,%edx
  801e1a:	39 d8                	cmp    %ebx,%eax
  801e1c:	76 12                	jbe    801e30 <__umoddi3+0x50>
  801e1e:	89 f0                	mov    %esi,%eax
  801e20:	89 da                	mov    %ebx,%edx
  801e22:	83 c4 1c             	add    $0x1c,%esp
  801e25:	5b                   	pop    %ebx
  801e26:	5e                   	pop    %esi
  801e27:	5f                   	pop    %edi
  801e28:	5d                   	pop    %ebp
  801e29:	c3                   	ret    
  801e2a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  801e30:	0f bd e8             	bsr    %eax,%ebp
  801e33:	83 f5 1f             	xor    $0x1f,%ebp
  801e36:	75 50                	jne    801e88 <__umoddi3+0xa8>
  801e38:	39 d8                	cmp    %ebx,%eax
  801e3a:	0f 82 e0 00 00 00    	jb     801f20 <__umoddi3+0x140>
  801e40:	89 d9                	mov    %ebx,%ecx
  801e42:	39 f7                	cmp    %esi,%edi
  801e44:	0f 86 d6 00 00 00    	jbe    801f20 <__umoddi3+0x140>
  801e4a:	89 d0                	mov    %edx,%eax
  801e4c:	89 ca                	mov    %ecx,%edx
  801e4e:	83 c4 1c             	add    $0x1c,%esp
  801e51:	5b                   	pop    %ebx
  801e52:	5e                   	pop    %esi
  801e53:	5f                   	pop    %edi
  801e54:	5d                   	pop    %ebp
  801e55:	c3                   	ret    
  801e56:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801e5d:	8d 76 00             	lea    0x0(%esi),%esi
  801e60:	89 fd                	mov    %edi,%ebp
  801e62:	85 ff                	test   %edi,%edi
  801e64:	75 0b                	jne    801e71 <__umoddi3+0x91>
  801e66:	b8 01 00 00 00       	mov    $0x1,%eax
  801e6b:	31 d2                	xor    %edx,%edx
  801e6d:	f7 f7                	div    %edi
  801e6f:	89 c5                	mov    %eax,%ebp
  801e71:	89 d8                	mov    %ebx,%eax
  801e73:	31 d2                	xor    %edx,%edx
  801e75:	f7 f5                	div    %ebp
  801e77:	89 f0                	mov    %esi,%eax
  801e79:	f7 f5                	div    %ebp
  801e7b:	89 d0                	mov    %edx,%eax
  801e7d:	31 d2                	xor    %edx,%edx
  801e7f:	eb 8c                	jmp    801e0d <__umoddi3+0x2d>
  801e81:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801e88:	89 e9                	mov    %ebp,%ecx
  801e8a:	ba 20 00 00 00       	mov    $0x20,%edx
  801e8f:	29 ea                	sub    %ebp,%edx
  801e91:	d3 e0                	shl    %cl,%eax
  801e93:	89 44 24 08          	mov    %eax,0x8(%esp)
  801e97:	89 d1                	mov    %edx,%ecx
  801e99:	89 f8                	mov    %edi,%eax
  801e9b:	d3 e8                	shr    %cl,%eax
  801e9d:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  801ea1:	89 54 24 04          	mov    %edx,0x4(%esp)
  801ea5:	8b 54 24 04          	mov    0x4(%esp),%edx
  801ea9:	09 c1                	or     %eax,%ecx
  801eab:	89 d8                	mov    %ebx,%eax
  801ead:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  801eb1:	89 e9                	mov    %ebp,%ecx
  801eb3:	d3 e7                	shl    %cl,%edi
  801eb5:	89 d1                	mov    %edx,%ecx
  801eb7:	d3 e8                	shr    %cl,%eax
  801eb9:	89 e9                	mov    %ebp,%ecx
  801ebb:	89 7c 24 0c          	mov    %edi,0xc(%esp)
  801ebf:	d3 e3                	shl    %cl,%ebx
  801ec1:	89 c7                	mov    %eax,%edi
  801ec3:	89 d1                	mov    %edx,%ecx
  801ec5:	89 f0                	mov    %esi,%eax
  801ec7:	d3 e8                	shr    %cl,%eax
  801ec9:	89 e9                	mov    %ebp,%ecx
  801ecb:	89 fa                	mov    %edi,%edx
  801ecd:	d3 e6                	shl    %cl,%esi
  801ecf:	09 d8                	or     %ebx,%eax
  801ed1:	f7 74 24 08          	divl   0x8(%esp)
  801ed5:	89 d1                	mov    %edx,%ecx
  801ed7:	89 f3                	mov    %esi,%ebx
  801ed9:	f7 64 24 0c          	mull   0xc(%esp)
  801edd:	89 c6                	mov    %eax,%esi
  801edf:	89 d7                	mov    %edx,%edi
  801ee1:	39 d1                	cmp    %edx,%ecx
  801ee3:	72 06                	jb     801eeb <__umoddi3+0x10b>
  801ee5:	75 10                	jne    801ef7 <__umoddi3+0x117>
  801ee7:	39 c3                	cmp    %eax,%ebx
  801ee9:	73 0c                	jae    801ef7 <__umoddi3+0x117>
  801eeb:	2b 44 24 0c          	sub    0xc(%esp),%eax
  801eef:	1b 54 24 08          	sbb    0x8(%esp),%edx
  801ef3:	89 d7                	mov    %edx,%edi
  801ef5:	89 c6                	mov    %eax,%esi
  801ef7:	89 ca                	mov    %ecx,%edx
  801ef9:	0f b6 4c 24 04       	movzbl 0x4(%esp),%ecx
  801efe:	29 f3                	sub    %esi,%ebx
  801f00:	19 fa                	sbb    %edi,%edx
  801f02:	89 d0                	mov    %edx,%eax
  801f04:	d3 e0                	shl    %cl,%eax
  801f06:	89 e9                	mov    %ebp,%ecx
  801f08:	d3 eb                	shr    %cl,%ebx
  801f0a:	d3 ea                	shr    %cl,%edx
  801f0c:	09 d8                	or     %ebx,%eax
  801f0e:	83 c4 1c             	add    $0x1c,%esp
  801f11:	5b                   	pop    %ebx
  801f12:	5e                   	pop    %esi
  801f13:	5f                   	pop    %edi
  801f14:	5d                   	pop    %ebp
  801f15:	c3                   	ret    
  801f16:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801f1d:	8d 76 00             	lea    0x0(%esi),%esi
  801f20:	29 fe                	sub    %edi,%esi
  801f22:	19 c3                	sbb    %eax,%ebx
  801f24:	89 f2                	mov    %esi,%edx
  801f26:	89 d9                	mov    %ebx,%ecx
  801f28:	e9 1d ff ff ff       	jmp    801e4a <__umoddi3+0x6a>
